From bb0ebc87716b709706c50c07980cc820fc6b204a Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Fri, 16 Oct 2020 14:41:38 +0200 Subject: [PATCH] refactoring --- src/misc.py | 2 +- src/photosort.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/misc.py b/src/misc.py index adb94b1..9f5d677 100644 --- a/src/misc.py +++ b/src/misc.py @@ -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) diff --git a/src/photosort.py b/src/photosort.py index 09f55d7..a4b319e 100755 --- a/src/photosort.py +++ b/src/photosort.py @@ -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) -- 2.39.5