change makedirs
This commit is contained in:
parent
b44c274924
commit
800eaa0915
1 changed files with 2 additions and 2 deletions
|
@ -110,12 +110,12 @@ class image_classifier:
|
||||||
else:
|
else:
|
||||||
folder = 'unknown-time'
|
folder = 'unknown-time'
|
||||||
new_path = os.path.join(dirname, folder, filename)
|
new_path = os.path.join(dirname, folder, filename)
|
||||||
if not os.path.exists(os.path.join(dirname, folder)):
|
if not os.path.exists(os.path.dirname(new_path)):
|
||||||
os.makedirs(os.path.dirname(new_path))
|
os.makedirs(os.path.dirname(new_path))
|
||||||
if self.people_folder:
|
if self.people_folder:
|
||||||
for person in people:
|
for person in people:
|
||||||
person_path = os.path.join(self.people_folder, person, folder, filename)
|
person_path = os.path.join(self.people_folder, person, folder, filename)
|
||||||
if not os.path.exists(os.path.join(self.people_folder, person, folder)):
|
if not os.path.exists(os.path.dirname(person_path)):
|
||||||
os.makedirs(os.path.dirname(person_path))
|
os.makedirs(os.path.dirname(person_path))
|
||||||
self._log.debug(f"Copying file '{file}' to '{person_path}'...")
|
self._log.debug(f"Copying file '{file}' to '{person_path}'...")
|
||||||
shutil.copy(file, person_path)
|
shutil.copy(file, person_path)
|
||||||
|
|
Loading…
Reference in a new issue