Merge branch 'by-date' into develop

This commit is contained in:
ryuslash 2010-03-22 15:18:15 +01:00
commit 018abb7da1

View file

@ -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: