From 4aa185a9cf79e48aeb51a248f40a63d530f9ec8b Mon Sep 17 00:00:00 2001 From: endorphant Date: Sun, 15 May 2016 02:04:02 -0400 Subject: [PATCH] moved month printing to chatter really, time.strftime should probably be used for this, but i got stuck on lowercase month names for consistency and would rather use my internal dict than lowercase the strftime return. --- bin/chatter.py | 3 +++ bin/core.py | 17 +---------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/bin/chatter.py b/bin/chatter.py index c027854..e95f621 100644 --- a/bin/chatter.py +++ b/bin/chatter.py @@ -12,3 +12,6 @@ langfile.close() def say(keyword): return random.choice(LANG.get(keyword)) + +def month(num): + return LANG["months"].get(num) diff --git a/bin/core.py b/bin/core.py index e768474..3909e23 100644 --- a/bin/core.py +++ b/bin/core.py @@ -21,21 +21,6 @@ HEADER = "" FOOTER = "" FILES = [] -MONTHS = { - "01":"january", - "02":"february", - "03":"march", - "04":"april", - "05":"may", - "06":"june", - "07":"july", - "08":"august", - "09":"september", - "10":"october", - "11":"november", - "12":"december" - } - def load(): global HEADER global FOOTER @@ -114,7 +99,7 @@ def write_entry(filename): entry = [ "\t\t



\n", "\t\t
\n", - "\t\t\t
"+date[2]+" "+MONTHS[date[1]]+" "+date[0]+"
\n" + "\t\t\t
"+date[2]+" "+chatter.month(date[1])+" "+date[0]+"
\n" #"\t\t\t

" ]