Files
ttbp/bin/chatter.py
endorphant 4aa185a9cf 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.
2016-05-15 02:04:02 -04:00

18 lines
340 B
Python

#!/usr/bin/python
import random
import json
import os
SOURCE = os.path.join("/home", "endorphant", "projects", "ttbp")
langfile = open(os.path.join(SOURCE, "lib", "lang.json"), 'r')
LANG = json.load(langfile)
langfile.close()
def say(keyword):
return random.choice(LANG.get(keyword))
def month(num):
return LANG["months"].get(num)