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): def __init__(self):
pass pass
def run(self, environment): def run(self, environment):
try: #this is the way to load the settings:
#Need to load time string from config file. # general is the section in the config file, timeFormat is the variable
except Exception as e: # this has to been added to settings.conf in sectino [general]
# Sane default # timeFormat=%H:%M;%P
timeString = '%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') timeString = datetime.datetime.strftime(datetime.datetime.now(), '%H:%M:%P')
return environment return environment