Update time.py

This commit is contained in:
chrys87 2016-08-25 17:28:46 +02:00 committed by GitHub
parent 4f760f5edb
commit 41c2341bf7

View File

@ -4,11 +4,14 @@ class command():
def __init__(self):
pass
def run(self, environment):
try:
#Need to load time string from config file.
except Exception as e:
# Sane default
timeString = '%H:%M;%P'
#this is the way to load the settings:
# general is the section in the config file, timeFormat is the variable
# this has to been added to settings.conf in sectino [general]
# timeFormat=%H:%M;%P
# the following has to been added to core/settings.py to the key 'general'
# the settings.py is used for default values
# 'timeFormat':"%H:%M;%P",
timeString = environment['runtime']['settingsManager'].getSetting(environment,'general', 'timeFormat')
timeString = datetime.datetime.strftime(datetime.datetime.now(), '%H:%M:%P')
return environment