Sorter also sorts by date now

This commit is contained in:
ryuslash 2010-03-22 15:17:55 +01:00
parent 4b70374e9d
commit 3980ccf38e

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: