finish up time example

This commit is contained in:
chrys
2016-08-26 01:42:31 +02:00
parent 5e08b9aff5
commit cbb41f8570
10 changed files with 64 additions and 3 deletions

View File

@ -1,5 +1,7 @@
#!/bin/python
import datetime
class command():
def __init__(self):
pass
@ -11,9 +13,14 @@ class command():
# 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')
timeFormat = environment['runtime']['settingsManager'].getSetting(environment,'general', 'timeFormat')
# get the time formatted
timeString = datetime.datetime.strftime(datetime.datetime.now(), timeFormat)
# present the time via speak and braile, there is no soundicon, interrupt the current speech
environment['runtime']['outputManager'].presentText(environment, timeString , soundIcon='', interrupt=True)
return environment
def setCallback(self, callback):
pass

View File

@ -34,6 +34,7 @@ settings = {
'punctuationLevel': 1,
'numberOfClipboards': 10,
'fenrirKeys':['82'],
'timeFormat':'%H:%M:%P',
},
'promote':{
'enabled': True,