diff --git a/sorter.py b/sorter.py index c52ab9a..dbaadba 100644 --- a/sorter.py +++ b/sorter.py @@ -21,6 +21,7 @@ import config import Image import shutil import os +import datetime def dummy_option_creator(value1, value2): pass config._optioncreator = dummy_option_creator @@ -67,8 +68,20 @@ class Sorter: download_base = self.conf.get_download_location() source = os.path.join(download_base, os.path.basename(filename)) + + today = datetime.date.today() dest = os.path.join(destpath, + "%d-%d-%d" % (today.year, today.month, today.day)) + if not os.path.exists(dest): + os.makedirs(dest) + + dest = os.path.join(dest, os.path.basename(filename)) + + #today = datetime.date.today() + #dest = os.path.join(dest, + # "%d-%d-%d" % (today.year, today.month, today.day)) + if source != dest: shutil.copy(source, dest) else: