Commits

Andy Mikhailenko committed d11f3bf

sort_files: fix bug in --exclude; minor presentation improvements

  • Participants
  • Parent commits 022d3ab

Comments (0)

Files changed (1)

File sort_files.py

 
     dest = os.path.join(inner_dest_dir, name)
     if verbosity >= 2:
-        print('  trying', src, '->', dest)
+        print('  trying', src, '', dest)
 
     if os.path.abspath(src) == os.path.abspath(dest):
         if verbosity >= 2:
-            print(t.red('  SKIP: source equals destination for {0}'.format(src)))
+            print(t.yellow('  SKIP: source equals destination for {0}'.format(src)))
         return SKIPPED
 
     # make sure the file does not exist there
             return ERROR
     else:
         if verbosity >= 1:
-            print(t.green('  moving "{0}" -> "{1}"'.format(src, dest)))
+            print(t.green('  moving "{0}"  "{1}"'.format(src, dest)))
         if not dry_run:
             os.rename(src, dest)
         return MOVED
     """
     time_start = datetime.datetime.now()
 
-    allowed_extensions = [x.strip() for x in extensions.split(',')]
-    patterns_to_ignore = [x.strip() for x in exclude.split(',')]
+    allowed_extensions = [x.strip() for x in extensions.split(',') if x.strip()]
+    patterns_to_ignore = [x.strip() for x in exclude.split(',') if x.strip()]
 
     if recursive:
         nodes = []