diff --git a/src/fenrir-package/commands/time.py b/src/fenrir-package/commands/time.py index 1cbfead8..84d5fe0a 100644 --- a/src/fenrir-package/commands/time.py +++ b/src/fenrir-package/commands/time.py @@ -4,12 +4,15 @@ 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 def setCallback(self, callback):