move some commands to onScreenUpdate (WIP)

This commit is contained in:
chrys 2017-06-30 20:08:38 +02:00
parent 8ca676271a
commit d90c6a85e1
2 changed files with 0 additions and 80 deletions

View File

@ -1,41 +0,0 @@
#!/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 'No Description found'
def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
return
# is there something to read?
if not self.env['runtime']['screenManager'].isDelta():
return
# its a cursor movement (experimental) - maybe also check current shortcut string?
#if not '$' in self.env['screen']['newDelta'] and
# not '#' in self.env['screen']['newDelta']:
if abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']) == 1:
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
return
if abs(self.env['screen']['newCursor']['y'] - self.env['screen']['oldCursor']['y']) == 1:
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
return
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=False, flush=False)
def setCallback(self, callback):
pass

View File

@ -1,39 +0,0 @@
#!/bin/python
import time
# -*- 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 'No Description found'
def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('promote', 'enabled'):
return
if self.env['runtime']['settingsManager'].getSetting('promote', 'list').strip(" \t\n") == '':
return
if self.env['screen']['newDelta'] == '':
return
if int(time.time() - self.env['input']['lastInputTime']) < self.env['runtime']['settingsManager'].getSettingAsInt('promote', 'inactiveTimeoutSec'):
return
if len(self.env['runtime']['settingsManager'].getSetting('promote', 'list')) == 0:
return
for promote in self.env['runtime']['settingsManager'].getSetting('promote', 'list').split(','):
if promote in self.env['screen']['newDelta']:
self.env['runtime']['outputManager'].playSoundIcon('PromotedText')
self.env['input']['lastInputTime'] = time.time()
return
def setCallback(self, callback):
pass