Changed time format slightly, added dte command, added fenrir+d command for date.
This commit is contained in:
28
src/fenrir-package/commands/commands/date.py
Normal file
28
src/fenrir-package/commands/commands/date.py
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/python
|
||||
|
||||
import datetime
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def run(self, environment):
|
||||
#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]
|
||||
# dateFormat="%A, %B %d, %Y"
|
||||
# the following has to been added to core/settings.py to the key 'general'
|
||||
# the settings.py is used for default values
|
||||
# dateFormat="%A, %B %d, %Y"
|
||||
dateFormat = environment['runtime']['settingsManager'].getSetting(environment,'general', 'dateFormat')
|
||||
|
||||
# get the time formatted
|
||||
dateString = datetime.datetime.strftime(datetime.datetime.now(), dateFormat)
|
||||
|
||||
# present the time via speak and braile, there is no soundicon, interrupt the current speech
|
||||
environment['runtime']['outputManager'].presentText(environment, dateString , soundIcon='', interrupt=True)
|
||||
|
||||
return environment
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
def shutdown(self):
|
||||
pass
|
@ -9,10 +9,10 @@ class command():
|
||||
#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
|
||||
# timeFormat=%I:%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",
|
||||
# 'timeFormat':"%I:%M%P",
|
||||
timeFormat = environment['runtime']['settingsManager'].getSetting(environment,'general', 'timeFormat')
|
||||
|
||||
# get the time formatted
|
||||
|
@ -35,7 +35,8 @@ settings = {
|
||||
'punctuationLevel': 1,
|
||||
'numberOfClipboards': 10,
|
||||
'fenrirKeys':['82'],
|
||||
'timeFormat':'%H:%M:%P',
|
||||
'timeFormat':'%I:%M%P',
|
||||
'dateFormat':'%A, %B %d, %Y',
|
||||
},
|
||||
'promote':{
|
||||
'enabled': True,
|
||||
|
Reference in New Issue
Block a user