Merge branch 'master' into wordWrappingEndOfScreenBell

This commit is contained in:
chrys 2016-11-09 23:26:41 +01:00
commit 680e624429
12 changed files with 119 additions and 4 deletions

4
TODO
View File

@ -8,6 +8,10 @@ ToDos in Priority order:
in special cases next word skipps a word, "word<12 spaces>word2<12 spaces>word3 (storm_dragon) in special cases next word skipps a word, "word<12 spaces>word2<12 spaces>word3 (storm_dragon)
spellcheck triggers twice if there are two spaces after an word and you arrow over them spellcheck triggers twice if there are two spaces after an word and you arrow over them
fenrir is not able to detect the current application inside of screen. fenrir is not able to detect the current application inside of screen.
ps -e -H -o pid,pgrp,ppid,tty,cmd
http://stackoverflow.com/questions/24861351/how-to-detect-if-python-script-is-being-run-as-a-background-process/24862213
fd = os.open("/dev/tty5", os.O_RDONLY )
os.tcgetpgrp(fd)
- implement onScreenUpdate commands - implement onScreenUpdate commands
read highlighted text mode read highlighted text mode

View File

@ -75,6 +75,7 @@ KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
KEY_FENRIR,KEY_BACKSLASH=toggle_output KEY_FENRIR,KEY_BACKSLASH=toggle_output
KEY_FENRIR,KEY_CTRL,KEY_E=toggle_emoticons KEY_FENRIR,KEY_CTRL,KEY_E=toggle_emoticons
key_FENRIR,KEY_KPENTER=toggle_auto_read key_FENRIR,KEY_KPENTER=toggle_auto_read
#=toggle_auto_time
KEY_FENRIR,KEY_KPASTERISK=toggle_highlight_tracking KEY_FENRIR,KEY_KPASTERISK=toggle_highlight_tracking
KEY_FENRIR,KEY_Q=quit_fenrir KEY_FENRIR,KEY_Q=quit_fenrir
KEY_FENRIR,KEY_T=time KEY_FENRIR,KEY_T=time

View File

@ -75,6 +75,7 @@ KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
KEY_FENRIR,KEY_SHIFT,KEY_ENTER=toggle_output KEY_FENRIR,KEY_SHIFT,KEY_ENTER=toggle_output
KEY_FENRIR,KEY_SHIFT,KEY_E=toggle_emoticons KEY_FENRIR,KEY_SHIFT,KEY_E=toggle_emoticons
KEY_FENRIR,KEY_ENTER=toggle_auto_read KEY_FENRIR,KEY_ENTER=toggle_auto_read
#=toggle_auto_time
KEY_FENRIR,KEY_Y=toggle_highlight_tracking KEY_FENRIR,KEY_Y=toggle_highlight_tracking
KEY_FENRIR,KEY_Q=quit_fenrir KEY_FENRIR,KEY_Q=quit_fenrir
KEY_FENRIR,KEY_T=time KEY_FENRIR,KEY_T=time

View File

@ -75,6 +75,7 @@ KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
KEY_FENRIR,KEY_BACKSLASH=toggle_output KEY_FENRIR,KEY_BACKSLASH=toggle_output
#=toggle_emoticons #=toggle_emoticons
key_FENRIR,KEY_KPENTER=toggle_auto_read key_FENRIR,KEY_KPENTER=toggle_auto_read
#=toggle_auto_time
#=toggle_highlight_tracking #=toggle_highlight_tracking
KEY_FENRIR,KEY_Q=quit_fenrir KEY_FENRIR,KEY_Q=quit_fenrir
KEY_FENRIR,KEY_T=time KEY_FENRIR,KEY_T=time

View File

@ -121,4 +121,8 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[time]
enabled=False
presentTime=True
presentDate=True
delaySec=3600

View File

@ -123,4 +123,12 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[time]
# automatic time anouncement
enabled=False
# present time
presentTime=True
# present date (on change)
presentDate=True
# present time after x seconds
delaySec=3600

View File

@ -123,4 +123,12 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[time]
# automatic time anouncement
enabled=False
# present time
presentTime=True
# present date (on change)
presentDate=True
# present time after x seconds
delaySec=3600

View File

@ -68,8 +68,17 @@ cursor=True
#follow highlighted text changes #follow highlighted text changes
highlight=False highlight=False
[promote] [promote]
enabled=True enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[time]
# automatic time anouncement
enabled=False
# present time
presentTime=True
# present date (on change)
presentDate=True
# present time after x seconds
delaySec=3600

View File

@ -0,0 +1,26 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'enables or disables automatic reading of time after an period'
def run(self):
self.env['runtime']['settingsManager'].setSetting('time', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled')))
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'):
self.env['runtime']['outputManager'].presentText("autotime enabled", soundIcon='', interrupt=True)
else:
self.env['runtime']['outputManager'].presentText("autotime disabled", soundIcon='', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -0,0 +1,46 @@
#!/bin/python
import time
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
import time
import datetime
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
self.lastTime = time.time()
self.lastDateString = ''
self.lastTimeString = ''
def shutdown(self):
pass
def getDescription(self):
return 'No Description found'
def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'):
return
if int(time.time() - self.lastTime) < self.env['runtime']['settingsManager'].getSettingAsInt('time', 'delaySec'):
return
timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat')
timeString = datetime.datetime.strftime(datetime.datetime.now(), timeFormat)
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
dateString = datetime.datetime.strftime(datetime.datetime.now(), dateFormat)
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentTime'):
# present the time
self.env['runtime']['outputManager'].presentText('Autotime: ' + timeString , soundIcon='', interrupt=False)
# and date if changes
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentDate'):
if self.lastDateString != dateString:
self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False)
self.lastDateString = dateString
self.lastTime = time.time()
self.lastTimeString = timeString
def setCallback(self, callback):
pass

View File

@ -64,6 +64,12 @@ settings = {
'inactiveTimeoutSec': 120, 'inactiveTimeoutSec': 120,
'list': '', 'list': '',
}, },
'time':{
'enabled': False,
'presentTime': True,
'presentDate': True,
'delaySec': 3600,
},
'keyboard':{ 'keyboard':{
'driver': 'evdev', 'driver': 'evdev',
'device': 'all', 'device': 'all',

View File

@ -69,6 +69,7 @@ class fenrir():
def prepareCommand(self): def prepareCommand(self):
if self.environment['runtime']['screenManager'].isSuspendingScreen(): if self.environment['runtime']['screenManager'].isSuspendingScreen():
self.wasCommand = False
return return
if self.environment['runtime']['inputManager'].noKeyPressed(): if self.environment['runtime']['inputManager'].noKeyPressed():
return return