diff --git a/bin/core.py b/bin/core.py index a2f75ca..6d94772 100644 --- a/bin/core.py +++ b/bin/core.py @@ -39,10 +39,12 @@ def write(outurl="default.html"): def write_entry(file): # dump given file into entry format, return as list of strings + date = parse_date(file) + entry = [ - "\t\t



\n", + "\t\t



\n", "\t\t
\n", - "\t\t\t
DD month YYYY
\n", + "\t\t\t
"+date[2]+" month "+date[0]+"
\n", "\t\t\t

" ] @@ -68,4 +70,8 @@ def parse_date(file): # assuming a filename of YYYYMMDD.txt, returns a list of # ['YYYY', 'MM', 'DD'] - return + rawdate = os.path.splitext(os.path.basename(file))[0] + + date = [rawdate[0:4], rawdate[4:6], rawdate[6:]] + + return date