Fixed Photo return value for overwriting source files.

This commit is contained in:
Marcus Scholz 2020-03-22 12:59:12 +01:00
parent 5a39f08f35
commit 3987d484ad

View File

@ -53,8 +53,9 @@ class Photo:
dry_run: whether to acutally write (True / False)
Returns:
self.get_date: timestamp of photo als datetime object
self.get_target_photo: full path to photo file to work on
get_date: timestamp of photo als datetime object
get_photo_filename: full path to photo file to work on
get_photo_basename: only filename (e. g. for print output)
'''
def __init__(self, photo, local_timezone, dest_dir, dry_run):
@ -67,9 +68,10 @@ class Photo:
def _copy_photo(self, photo, dest_dir, dry_run):
# Determine where to work on photo and copy it there if needed.
# Get image file name out of path
photo_basename = os.path.basename(photo)
# be os aware and use the correct directory delimiter for destfile
# be os aware and use the correct directory delimiter for dest_photo
dest_photo = os.path.join(dest_dir, photo_basename)
# Copy photo to dest_dir and return its (new) filename
@ -78,7 +80,8 @@ class Photo:
return photo_basename, photo
if dest_dir != '.':
shutil.copy(photo, dest_photo)
return photo_basename, dest_photo
return photo_basename, dest_photo
return photo_basename, photo
def _get_creation_date(self, photo, local_timezone):
# Load Exif data from photo
@ -103,7 +106,7 @@ class Match:
Returns:
minimal timedelta: as timedelta object
best matching valuerow
best matching values
'''
def __init__(self, photo_time, radiation_list, position_list):