]> git.treefish.org Git - photosort.git/commitdiff
refactoring
authorAlexander Schmidt <alex@treefish.org>
Fri, 16 Oct 2020 12:41:38 +0000 (14:41 +0200)
committerAlexander Schmidt <alex@treefish.org>
Fri, 16 Oct 2020 12:41:38 +0000 (14:41 +0200)
src/misc.py
src/photosort.py

index adb94b11a6585b4c55f058b3e960d09517608291..9f5d677ff8abce6a477a1973dc174f68ad7ebe9c 100644 (file)
@@ -32,7 +32,7 @@ def find_file(dir_path, file_name, file_size, exclude_dir):
                     return root
     return None
 
-def import_file(src_file_path, dst_file_path, move=False):
+def import_file(src_file_path, dst_file_path):
     shutil.copyfile(src_file_path, dst_file_path)
     src_stat = os.stat(src_file_path)
     dst_stat = os.stat(dst_file_path)
index 09f55d727515ffd58d105b7ceab2038df541bb80..a4b319ebf12044413079359fed49b153af892968 100755 (executable)
@@ -42,12 +42,12 @@ for src_file_name, src_file_path in misc.walk_media_files(args.SOURCE_DIR):
     if not os.path.exists(dst_file_path):
         if not os.path.exists(dst_dir):
             os.makedirs(dst_dir)
-        misc.import_file(src_file_path, dst_file_path, move=args.cleanup)
+        misc.import_file(src_file_path, dst_file_path)
     else:
         src_time = misc.extract_timestamp(src_file_path)
         dst_time = misc.extract_timestamp(dst_file_path)
         if src_time > dst_time:
-            misc.import_file(src_file_path, dst_file_path, move=args.cleanup)
+            misc.import_file(src_file_path, dst_file_path)
 
 if args.cleanup:
     misc.delete_dir_contents(args.SOURCE_DIR)