To 2099
This commit is contained in:
parent
1b92395e58
commit
30a45370be
1 changed files with 2 additions and 2 deletions
|
@ -95,11 +95,11 @@ class image_classifier:
|
||||||
self._log.debug(f"New path: {new_path}")
|
self._log.debug(f"New path: {new_path}")
|
||||||
os.makedirs(os.path.dirname(new_path), exist_ok=True)
|
os.makedirs(os.path.dirname(new_path), exist_ok=True)
|
||||||
if not new_path:
|
if not new_path:
|
||||||
match = re.search(r'(?P<year>2[0-9]{3})[\-/\._]?(?P<month>[0-1]?[0-9])[\-/\._]?(?P<day>[0-3]?[0-9])', filename)
|
match = re.search(r'(?P<year>20[0-9]{2})[\-/\._]?(?P<month>[0-1]?[0-9])[\-/\._]?(?P<day>[0-3]?[0-9])', filename)
|
||||||
if match:
|
if match:
|
||||||
new_path = os.path.join(dirname, match.group('year'), match.group('month'), match.group('day'), filename)
|
new_path = os.path.join(dirname, match.group('year'), match.group('month'), match.group('day'), filename)
|
||||||
if not new_path:
|
if not new_path:
|
||||||
match = re.search(r'(?P<day>[0-3]?[0-9])[\-/\._]?(?P<month>[0-1]?[0-9])[\-/\._]?(?P<year>2[0-9]{3})', filename)
|
match = re.search(r'(?P<day>[0-3]?[0-9])[\-/\._]?(?P<month>[0-1]?[0-9])[\-/\._]?(?P<year>20[0-9]{2})', filename)
|
||||||
if match:
|
if match:
|
||||||
new_path = os.path.join(dirname, match.group('year'), match.group('month'), match.group('day'), filename)
|
new_path = os.path.join(dirname, match.group('year'), match.group('month'), match.group('day'), filename)
|
||||||
if not new_path:
|
if not new_path:
|
||||||
|
|
Loading…
Reference in a new issue