tune commands

This commit is contained in:
chrys 2017-01-30 20:42:04 +01:00
parent 6c63317e33
commit 6a614c8d6b
10 changed files with 12 additions and 12 deletions

View File

@ -37,7 +37,7 @@ class command():
return return
x, y, currChar = char_utils.getCurrentChar(self.env['screenData']['newCursor']['x'], self.env['screenData']['newCursor']['y'], self.env['screenData']['newContentText']) x, y, currChar = char_utils.getCurrentChar(self.env['screenData']['newCursor']['x'], self.env['screenData']['newCursor']['y'], self.env['screenData']['newContentText'])
if not currChar.isspace(): if not currChar.isspace():
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True) self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -33,7 +33,7 @@ class command():
if len(currDelta.strip()) != len(currDelta) and \ if len(currDelta.strip()) != len(currDelta) and \
currDelta.strip() != '': currDelta.strip() != '':
currDelta = currDelta.strip() currDelta = currDelta.strip()
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True) self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -33,7 +33,7 @@ class command():
x, y, currLine = line_utils.getCurrentLine(self.env['screenData']['newCursor']['x'], self.env['screenData']['newCursor']['y'], self.env['screenData']['newContentText']) x, y, currLine = line_utils.getCurrentLine(self.env['screenData']['newCursor']['x'], self.env['screenData']['newCursor']['y'], self.env['screenData']['newContentText'])
if currLine.isspace(): if currLine.isspace():
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True) self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True) self.env['runtime']['outputManager'].presentText(currLine, interrupt=True)

View File

@ -50,7 +50,7 @@ class command():
return return
if currWord != '': if currWord != '':
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True) self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -126,7 +126,7 @@ class command():
pass pass
if not self.spellChecker.check(currWord): if not self.spellChecker.check(currWord):
self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=False) self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=False, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -42,7 +42,7 @@ class command():
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \ if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
currNegativeDelta.strip() != '': currNegativeDelta.strip() != '':
currNegativeDelta = currNegativeDelta.strip() currNegativeDelta = currNegativeDelta.strip()
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True) self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -47,7 +47,7 @@ class command():
announce = currLine announce = currLine
if currLine.isspace(): if currLine.isspace():
self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True) self.env['runtime']['outputManager'].presentText("blank", soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(announce, interrupt=True) self.env['runtime']['outputManager'].presentText(announce, interrupt=True)
self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True self.env['commandsIgnore']['onScreenUpdate']['CHAR_DELETE_ECHO'] = True

View File

@ -17,8 +17,8 @@ class command():
return 'No Description found' return 'No Description found'
def run(self): def run(self):
self.env['runtime']['outputManager'].presentText("screen " + str(self.env['screenData']['newTTY']),soundIcon='ChangeTTY', interrupt=True) self.env['runtime']['outputManager'].presentText("screen " + str(self.env['screenData']['newTTY']),soundIcon='ChangeTTY', interrupt=True, flush=False)
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newContentText'], interrupt=False) self.env['runtime']['outputManager'].presentText(self.env['screenData']['newContentText'], interrupt=False, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -24,7 +24,7 @@ class outputManager():
self.env['runtime']['settingsManager'].shutdownDriver('speechDriver') self.env['runtime']['settingsManager'].shutdownDriver('speechDriver')
self.env['runtime']['settingsManager'].shutdownDriver('brailleDriver') self.env['runtime']['settingsManager'].shutdownDriver('brailleDriver')
def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False, announceCapital=False, flush=False): def presentText(self, text, interrupt=True, soundIcon = '', ignorePunctuation=False, announceCapital=False, flush=True):
if text == '': if text == '':
return return
self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO) self.env['runtime']['debug'].writeDebugOut("presentText:\nsoundIcon:'"+soundIcon+"'\nText:\n" + text ,debug.debugLevel.INFO)
@ -100,7 +100,7 @@ class outputManager():
self.env['runtime']['debug'].writeDebugOut("\"speak\" in outputManager.speakText ",debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut("\"speak\" in outputManager.speakText ",debug.debugLevel.ERROR)
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
def brailleText(self, text='', flush=False): def brailleText(self, text='', flush=True):
if not self.env['runtime']['settingsManager'].getSettingAsBool('braille', 'enabled'): if not self.env['runtime']['settingsManager'].getSettingAsBool('braille', 'enabled'):
return return
if self.env['runtime']['brailleDriver'] == None: if self.env['runtime']['brailleDriver'] == None:

View File

@ -64,7 +64,7 @@ class fenrir():
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenChanged') self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenChanged')
else: else:
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate') self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate')
self.environment['runtime']['outputManager'].brailleText() self.environment['runtime']['outputManager'].brailleText(flush=False)
self.handleCommands() self.handleCommands()
#print(time.time()-startTime) #print(time.time()-startTime)