remove first
This commit is contained in:
parent
86deb0c7f8
commit
3bc270f67a
1 changed files with 3 additions and 0 deletions
|
@ -126,6 +126,9 @@ class image_classifier:
|
|||
'{person_path}'...")
|
||||
shutil.copy(file, person_path)
|
||||
if not self.no_move:
|
||||
if os.path.exists(os.path.join(new_path, filename)):
|
||||
self._log.debug(f"Destination '{new_path}/{filename}' exists, removing it...")
|
||||
os.remove(os.path.join(new_path, filename))
|
||||
self._log.info(f"Moving file '{file}' to '{new_path}'...")
|
||||
shutil.move(file, new_path)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue