unify names
This commit is contained in:
parent
d08c7d772e
commit
5f1d6f4350
@ -40,7 +40,7 @@ class command():
|
||||
return
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
# get the word
|
||||
newContent = self.env['screenData']['newContentText'].split('\n')[cursorPos['y']]
|
||||
newContent = self.env['screen']['newContentText'].split('\n')[cursorPos['y']]
|
||||
x, y, currWord, endOfScreen, lineBreak = word_utils.getCurrentWord(cursorPos['x'], 0, newContent)
|
||||
currWord = currWord.strip(string.whitespace + '!"#$%&\()*+,-./:;<=§>?@[\\]^_{|}~')
|
||||
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -35,10 +35,10 @@ class command():
|
||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
else:
|
||||
x, y, marked = \
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
|
@ -28,7 +28,7 @@ class command():
|
||||
startMark = self.env['commandBuffer']['Marks']['1'].copy()
|
||||
endMark = self.env['commandBuffer']['Marks']['2'].copy()
|
||||
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
|
||||
self.env['commandBuffer']['clipboard'] = [marked] + self.env['commandBuffer']['clipboard'][:self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards') -1]
|
||||
self.env['commandBuffer']['currClipboard'] = 0
|
||||
|
@ -17,10 +17,10 @@ class command():
|
||||
return _('reads the contents of the current screen')
|
||||
|
||||
def run(self):
|
||||
if self.env['screenData']['newContentText'].isspace():
|
||||
if self.env['screen']['newContentText'].isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("screen is empty"), soundIcon='EmptyLine', interrupt=True)
|
||||
else:
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newContentText'],interrupt=True)
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newContentText'],interrupt=True)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -21,7 +21,7 @@ class command():
|
||||
# Prefer review cursor over text cursor
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
|
||||
textAfterCursor = mark_utils.getTextAfterMark(cursorPos, self.env['screenData']['newContentText'])
|
||||
textAfterCursor = mark_utils.getTextAfterMark(cursorPos, self.env['screen']['newContentText'])
|
||||
|
||||
if textAfterCursor.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
||||
|
@ -19,12 +19,12 @@ class command():
|
||||
|
||||
def run(self):
|
||||
# Prefer review cursor over text cursor
|
||||
if self.env['screenData']['newCursorReview']:
|
||||
cursorPos = self.env['screenData']['newCursorReview'].copy()
|
||||
if self.env['screen']['newCursorReview']:
|
||||
cursorPos = self.env['screen']['newCursorReview'].copy()
|
||||
else:
|
||||
cursorPos = self.env['screenData']['newCursor'].copy()
|
||||
cursorPos = self.env['screen']['newCursor'].copy()
|
||||
|
||||
textBeforeCursor = mark_utils.getTextBeforeMark(cursorPos, self.env['screenData']['newContentText'])
|
||||
textBeforeCursor = mark_utils.getTextBeforeMark(cursorPos, self.env['screen']['newContentText'])
|
||||
|
||||
if textBeforeCursor.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
||||
|
@ -21,7 +21,7 @@ class command():
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
|
||||
x, y, currLine = \
|
||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if currLine.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
||||
|
@ -46,7 +46,7 @@ class command():
|
||||
print('4')
|
||||
return
|
||||
print('doit')
|
||||
p = Popen('su -c "echo -n \"' + self.env['commandBuffer']['clipboard'][currClipboard] +'\" | xclip -d :0 -selection c' + self.env['generalInformation']['currUser'] , stdout=PIPE, stderr=PIPE, shell=True)
|
||||
p = Popen('su -c "echo -n \"' + self.env['commandBuffer']['clipboard'][currClipboard] +'\" | xclip -d :0 -selection c' + self.env['general']['currUser'] , stdout=PIPE, stderr=PIPE, shell=True)
|
||||
stdout, stderr = p.communicate()
|
||||
self.env['runtime']['outputManager'].interruptOutput()
|
||||
screenEncoding = self.env['runtime']['settingsManager'].getSetting('screen', 'encoding')
|
||||
|
@ -20,12 +20,12 @@ class command():
|
||||
def run(self):
|
||||
# Prefer review cursor over text cursor
|
||||
|
||||
if self.env['screenData']['newCursorReview']:
|
||||
cursorPos = self.env['screenData']['newCursorReview'].copy()
|
||||
if self.env['screen']['newCursorReview']:
|
||||
cursorPos = self.env['screen']['newCursorReview'].copy()
|
||||
else:
|
||||
cursorPos = self.env['screenData']['newCursor'].copy()
|
||||
cursorPos = self.env['screen']['newCursor'].copy()
|
||||
x, y, currLine = \
|
||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if currLine.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
||||
|
@ -17,7 +17,7 @@ class command():
|
||||
return _('displays the last received text')
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=True)
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=True)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -27,7 +27,7 @@ class command():
|
||||
startMark = self.env['commandBuffer']['Marks']['1'].copy()
|
||||
endMark = self.env['commandBuffer']['Marks']['2'].copy()
|
||||
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screenData']['newContentText'])
|
||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
||||
|
||||
if marked.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
||||
|
@ -19,7 +19,7 @@ class command():
|
||||
|
||||
def run(self):
|
||||
x, y, firstLine = \
|
||||
line_utils.getCurrentLine(0, 0, self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(0, 0, self.env['screen']['newContentText'])
|
||||
|
||||
if firstLine.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
||||
|
@ -19,7 +19,7 @@ class command():
|
||||
|
||||
def run(self):
|
||||
x, y, lastLine = \
|
||||
line_utils.getCurrentLine(0, self.env['screenData']['lines'] -1, self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(0, self.env['screen']['lines'] -1, self.env['screen']['newContentText'])
|
||||
|
||||
if lastLine.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
||||
|
@ -17,7 +17,7 @@ class command():
|
||||
return _('exits Fenrir')
|
||||
|
||||
def run(self):
|
||||
self.env['generalInformation']['running'] = False
|
||||
self.env['general']['running'] = False
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -42,7 +42,7 @@ class command():
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
|
||||
# get the word
|
||||
newContent = self.env['screenData']['newContentText'].split('\n')[cursorPos['y']]
|
||||
newContent = self.env['screen']['newContentText'].split('\n')[cursorPos['y']]
|
||||
x, y, currWord, endOfScreen, lineBreak = word_utils.getCurrentWord(cursorPos['x'], 0, newContent)
|
||||
currWord = currWord.strip(string.whitespace + '!"#$%&\()*+,-./:;<=§>?@[\\]^_{|}~')
|
||||
if not currWord.isspace():
|
||||
|
@ -17,7 +17,7 @@ class command():
|
||||
return _('move review to bottom of screen')
|
||||
|
||||
def run(self):
|
||||
self.env['screenData']['newCursorReview'] = { 'x': 0, 'y':self.env['screenData']['lines'] -1}
|
||||
self.env['screen']['newCursorReview'] = { 'x': 0, 'y':self.env['screen']['lines'] -1}
|
||||
self.env['runtime']['outputManager'].presentText(_("Bottom"), interrupt=True, flush=False)
|
||||
|
||||
def setCallback(self, callback):
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if currChar.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currLine = \
|
||||
line_utils.getCurrentLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currLine = \
|
||||
line_utils.getCurrentLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if currLine.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
||||
word_utils.getCurrentWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
||||
word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if currWord.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
||||
word_utils.getCurrentWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
||||
word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if currWord.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||
|
@ -19,8 +19,8 @@ class command():
|
||||
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], downChar, endOfScreen = \
|
||||
char_utils.getDownChar(self.env['screenData']['newCursorReview']['x'],self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], downChar, endOfScreen = \
|
||||
char_utils.getDownChar(self.env['screen']['newCursorReview']['x'],self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
self.env['runtime']['outputManager'].presentText(downChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
if endOfScreen:
|
||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
self.env['runtime']['cursorManager'].setReviewCursorPosition(0 ,cursorPos['y'])
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if currChar.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||
|
@ -19,9 +19,9 @@ class command():
|
||||
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
self.env['runtime']['cursorManager'].setReviewCursorPosition(self.env['screenData']['columns']-1 ,cursorPos['y'])
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['runtime']['cursorManager'].setReviewCursorPosition(self.env['screen']['columns']-1 ,cursorPos['y'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText(_("end of line"), interrupt=False)
|
||||
|
@ -21,13 +21,13 @@ class command():
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
x, y, currLine = \
|
||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screenData']['newContentText'])
|
||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screen']['newContentText'])
|
||||
if currLine.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("line is empty"), interrupt=True)
|
||||
return
|
||||
self.env['runtime']['cursorManager'].setReviewCursorPosition((len(currLine) - len(currLine.lstrip())), cursorPos['y'])
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText(_("first char in line indent {0}").format(str(len(currLine) - len(currLine.lstrip()))), interrupt=False)
|
||||
|
@ -19,9 +19,9 @@ class command():
|
||||
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
self.env['runtime']['cursorManager'].setReviewCursorPosition(self.env['screenData']['columns']-1 ,cursorPos['y'])
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], lastChar = \
|
||||
char_utils.getLastCharInLine(self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['runtime']['cursorManager'].setReviewCursorPosition(self.env['screen']['columns']-1 ,cursorPos['y'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], lastChar = \
|
||||
char_utils.getLastCharInLine(self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
self.env['runtime']['outputManager'].presentText(lastChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText(_("last char in line"), interrupt=False)
|
||||
|
@ -19,8 +19,8 @@ class command():
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextChar, endOfScreen, lineBreak = \
|
||||
char_utils.getNextChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextChar, endOfScreen, lineBreak = \
|
||||
char_utils.getNextChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
self.env['runtime']['outputManager'].presentText(nextChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
if endOfScreen:
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextChar, endOfScreen, lineBreak = \
|
||||
char_utils.getNextChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextChar, endOfScreen, lineBreak = \
|
||||
char_utils.getNextChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
nextChar = char_utils.getPhonetic(nextChar)
|
||||
self.env['runtime']['outputManager'].presentText(nextChar ,interrupt=True, announceCapital=True, flush=False)
|
||||
|
@ -18,12 +18,12 @@ class command():
|
||||
return _('moves review to the next line and presents it')
|
||||
|
||||
def run(self):
|
||||
self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview']
|
||||
if not self.env['screenData']['newCursorReview']:
|
||||
self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursor'].copy()
|
||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
||||
if not self.env['screen']['newCursorReview']:
|
||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextLine, endOfScreen = \
|
||||
line_utils.getNextLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextLine, endOfScreen = \
|
||||
line_utils.getNextLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if nextLine.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||
|
@ -18,12 +18,12 @@ class command():
|
||||
return _('moves review to the next word and presents it')
|
||||
|
||||
def run(self):
|
||||
self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview']
|
||||
if self.env['screenData']['newCursorReview'] == None:
|
||||
self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursor'].copy()
|
||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
||||
if self.env['screen']['newCursorReview'] == None:
|
||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
||||
word_utils.getNextWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
||||
word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if nextWord.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
||||
word_utils.getNextWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
||||
word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if nextWord.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||
|
@ -18,12 +18,12 @@ class command():
|
||||
return _('moves review to the previous character and presents it')
|
||||
|
||||
def run(self):
|
||||
self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview']
|
||||
if not self.env['screenData']['newCursorReview']:
|
||||
self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursor'].copy()
|
||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
||||
if not self.env['screen']['newCursorReview']:
|
||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], prevChar, endOfScreen, lineBreak = \
|
||||
char_utils.getPrevChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevChar, endOfScreen, lineBreak = \
|
||||
char_utils.getPrevChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
self.env['runtime']['outputManager'].presentText(prevChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
if endOfScreen:
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], prevChar, endOfScreen, lineBreak = \
|
||||
char_utils.getPrevChar(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevChar, endOfScreen, lineBreak = \
|
||||
char_utils.getPrevChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
prevChar = char_utils.getPhonetic(prevChar)
|
||||
self.env['runtime']['outputManager'].presentText(prevChar ,interrupt=True, announceCapital=True, flush=False)
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], prevLine, endOfScreen = \
|
||||
line_utils.getPrevLine(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevLine, endOfScreen = \
|
||||
line_utils.getPrevLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if prevLine.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
||||
word_utils.getPrevWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
||||
word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if prevWord.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||
|
@ -20,8 +20,8 @@ class command():
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
||||
word_utils.getPrevWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
||||
word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if prevWord.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
||||
|
@ -18,7 +18,7 @@ class command():
|
||||
return _('move review to top of screen')
|
||||
|
||||
def run(self):
|
||||
self.env['screenData']['newCursorReview'] = {'x':0,'y':0}
|
||||
self.env['screen']['newCursorReview'] = {'x':0,'y':0}
|
||||
self.env['runtime']['outputManager'].presentText(_("Top"), interrupt=True, flush=False)
|
||||
|
||||
def setCallback(self, callback):
|
||||
|
@ -19,8 +19,8 @@ class command():
|
||||
|
||||
def run(self):
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], upChar, endOfScreen = \
|
||||
char_utils.getUpChar(self.env['screenData']['newCursorReview']['x'],self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
|
||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], upChar, endOfScreen = \
|
||||
char_utils.getUpChar(self.env['screen']['newCursorReview']['x'],self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
||||
self.env['runtime']['outputManager'].presentText(upChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
if endOfScreen:
|
||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
||||
|
@ -44,7 +44,7 @@ class command():
|
||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
||||
|
||||
# get the word
|
||||
newContent = self.env['screenData']['newContentText'].split('\n')[cursorPos['y']]
|
||||
newContent = self.env['screen']['newContentText'].split('\n')[cursorPos['y']]
|
||||
x, y, currWord, endOfScreen, lineBreak = word_utils.getCurrentWord(cursorPos['x'], 0, newContent)
|
||||
|
||||
if not currWord.isspace():
|
||||
|
@ -14,13 +14,13 @@ class command():
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
self.env['generalInformation']['tutorialMode'] = False
|
||||
self.env['general']['tutorialMode'] = False
|
||||
return _('You are leaving the tutorial mode. Press that shortcut again to enter the tutorial mode again.')
|
||||
|
||||
def run(self):
|
||||
text = _('you entered the tutorial mode. In that mode the commands are not executed. but you get a description of what the shortcut does. To leave the tutorial mode, press that shortcut again.')
|
||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
||||
self.env['generalInformation']['tutorialMode'] = True
|
||||
self.env['general']['tutorialMode'] = True
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -1,25 +1,25 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/bi[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]/py[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]ho[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]
|
||||
# -*- [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]odi[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]g: u[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]f-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
# F[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]i[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']] TTY [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']] [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]
|
||||
# By Ch[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]y[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']], S[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]o[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]m [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]go[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']], [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]d [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]o[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]ibu[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']].
|
||||
|
||||
from core import debug
|
||||
f[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]om [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]o[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']] impo[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']] d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]bug
|
||||
|
||||
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):
|
||||
#print('new ', self.env['screenData']['newApplication'])
|
||||
#print('old ', self.env['screenData']['oldApplication'])
|
||||
#print('-----------')
|
||||
pass
|
||||
[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]l[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']] [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]omm[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]d():
|
||||
d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]f __i[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]i[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]__([['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]lf):
|
||||
p[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]
|
||||
d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]f i[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]i[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]i[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]liz[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]([['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]lf, [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]vi[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]o[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]m[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]):
|
||||
[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]lf.[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]v = [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]vi[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]o[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]m[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]
|
||||
d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]f [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]hu[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]dow[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]([['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]lf):
|
||||
p[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]
|
||||
d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]f g[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]ip[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]io[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]([['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]lf):
|
||||
[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]u[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']] [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]No d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]ip[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]io[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']] fou[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]
|
||||
d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]f [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]u[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]([['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]lf):
|
||||
#p[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]i[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]([['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]w [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']], [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]lf.[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]v[[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]][[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]wAppli[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]io[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]])
|
||||
#p[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]i[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]([['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]old [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']], [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]lf.[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]v[[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]][[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]oldAppli[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]io[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]])
|
||||
#p[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]i[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]([['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]-----------[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']])
|
||||
p[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
d[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]f [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]C[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]llb[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]k([['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]lf, [['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]llb[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]k):
|
||||
p[['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']][['screen']['screen']['screen']['screen']['screen']['screen']['screen']['screen']]
|
||||
|
@ -35,7 +35,7 @@ class command():
|
||||
# is it a horizontal change?
|
||||
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
|
||||
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['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||
if not currChar.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
||||
def setCallback(self, callback):
|
||||
|
@ -20,16 +20,16 @@ class command():
|
||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'):
|
||||
return
|
||||
# detect deletion or chilling
|
||||
if self.env['screenData']['newCursor']['x'] <= self.env['screenData']['oldCursor']['x']:
|
||||
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
|
||||
return
|
||||
# is there any change?
|
||||
if not self.env['runtime']['screenManager'].isDelta():
|
||||
return
|
||||
# big changes are no char (but the value is bigger than one maybe the differ needs longer than you can type, so a little strange random buffer for now)
|
||||
if len(self.env['screenData']['newDelta']) > 3:
|
||||
if len(self.env['screen']['newDelta']) > 3:
|
||||
return
|
||||
# filter unneded space on word begin
|
||||
currDelta = self.env['screenData']['newDelta']
|
||||
currDelta = self.env['screen']['newDelta']
|
||||
if len(currDelta.strip()) != len(currDelta) and \
|
||||
currDelta.strip() != '':
|
||||
currDelta = currDelta.strip()
|
||||
|
@ -26,14 +26,14 @@ class command():
|
||||
return
|
||||
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack
|
||||
if self.env['runtime']['screenManager'].isDelta():
|
||||
if len(self.env['screenData']['newDelta']) > 4:
|
||||
if len(self.env['screen']['newDelta']) > 4:
|
||||
return
|
||||
|
||||
# is a vertical change?
|
||||
if not self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||
return
|
||||
|
||||
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['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
|
||||
|
||||
if currLine.isspace():
|
||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
||||
|
@ -18,7 +18,7 @@ class command():
|
||||
def run(self):
|
||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
|
||||
return
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newAttribDelta'], soundIcon='', interrupt=True, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newAttribDelta'], soundIcon='', interrupt=True, flush=False)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -20,7 +20,7 @@ class command():
|
||||
|
||||
def run(self):
|
||||
# first place could not be the end of a word
|
||||
if self.env['screenData']['newCursor']['x'] == 0:
|
||||
if self.env['screen']['newCursor']['x'] == 0:
|
||||
return
|
||||
# is it enabled?
|
||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
|
||||
@ -35,18 +35,18 @@ class command():
|
||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||
return
|
||||
# get the word
|
||||
newContent = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||
x, y, currWord, endOfScreen, lineBreak = \
|
||||
word_utils.getCurrentWord(self.env['screenData']['newCursor']['x'], 0, newContent)
|
||||
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||
# currently writing
|
||||
if self.env['runtime']['screenManager'].isDelta():
|
||||
return
|
||||
else:
|
||||
# at the end of a word
|
||||
if not newContent[self.env['screenData']['newCursor']['x']].isspace():
|
||||
if not newContent[self.env['screen']['newCursor']['x']].isspace():
|
||||
return
|
||||
if (x + len(currWord) != self.env['screenData']['newCursor']['x']) and \
|
||||
(x + len(currWord) != self.env['screenData']['newCursor']['x']-1):
|
||||
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
||||
(x + len(currWord) != self.env['screen']['newCursor']['x']-1):
|
||||
return
|
||||
|
||||
if currWord != '':
|
||||
|
@ -55,35 +55,35 @@ class command():
|
||||
if self.env['runtime']['cursorManager'].isCursorVerticalMove():
|
||||
return
|
||||
# more than a keyecho?
|
||||
if len(self.env['screenData']['newDelta']) > 1:
|
||||
if len(self.env['screen']['newDelta']) > 1:
|
||||
return
|
||||
# deletion
|
||||
if self.env['runtime']['screenManager'].isNegativeDelta():
|
||||
return
|
||||
# first place could not be the end of a word
|
||||
if self.env['screenData']['newCursor']['x'] == 0:
|
||||
if self.env['screen']['newCursor']['x'] == 0:
|
||||
return
|
||||
|
||||
# get the word (just for speedup only look at current line
|
||||
newContent = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
||||
x, y, currWord, endOfScreen, lineBreak = word_utils.getCurrentWord(self.env['screenData']['newCursor']['x'], 0, newContent)
|
||||
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||
x, y, currWord, endOfScreen, lineBreak = word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
|
||||
# was this a typed word?
|
||||
if self.env['runtime']['screenManager'].isDelta():
|
||||
if not(newContent[self.env['screenData']['oldCursor']['x']] in string.whitespace + '!"#$%&()*+,-./:;<=>?@[\\]^_{|}~' and x != self.env['screenData']['oldCursor']['x']):
|
||||
if not(newContent[self.env['screen']['oldCursor']['x']] in string.whitespace + '!"#$%&()*+,-./:;<=>?@[\\]^_{|}~' and x != self.env['screen']['oldCursor']['x']):
|
||||
return
|
||||
else:
|
||||
currWord = currWord.strip(string.whitespace + '!"#$%&()*+,-./:;<=>?@[\\]^_{|}~')
|
||||
else:
|
||||
# or just arrow arround?
|
||||
if not newContent[self.env['screenData']['newCursor']['x']].isspace():
|
||||
if not newContent[self.env['screen']['newCursor']['x']].isspace():
|
||||
return
|
||||
if (x + len(currWord) != self.env['screenData']['newCursor']['x']) and \
|
||||
(x + len(currWord) != self.env['screenData']['newCursor']['x']-1):
|
||||
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
|
||||
(x + len(currWord) != self.env['screen']['newCursor']['x']-1):
|
||||
return
|
||||
|
||||
# just on end of word
|
||||
if self.env['screenData']['newCursor']['x'] > 0:
|
||||
if not newContent[self.env['screenData']['oldCursor']['x'] - 1].lower() in string.ascii_lowercase:
|
||||
if self.env['screen']['newCursor']['x'] > 0:
|
||||
if not newContent[self.env['screen']['oldCursor']['x'] - 1].lower() in string.ascii_lowercase:
|
||||
return
|
||||
|
||||
# ignore bash buildins
|
||||
|
@ -21,7 +21,7 @@ class command():
|
||||
return
|
||||
|
||||
# detect typing or chilling
|
||||
if self.env['screenData']['newCursor']['x'] >= self.env['screenData']['oldCursor']['x']:
|
||||
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
|
||||
return
|
||||
|
||||
# More than just a deletion happend
|
||||
@ -36,9 +36,9 @@ class command():
|
||||
|
||||
# too much for a single backspace...
|
||||
# word begin produce a diff wiht len == 2 |a | others with 1 |a|
|
||||
if len(self.env['screenData']['newNegativeDelta']) > 2:
|
||||
if len(self.env['screen']['newNegativeDelta']) > 2:
|
||||
return
|
||||
currNegativeDelta = self.env['screenData']['newNegativeDelta']
|
||||
currNegativeDelta = self.env['screen']['newNegativeDelta']
|
||||
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
|
||||
currNegativeDelta.strip() != '':
|
||||
currNegativeDelta = currNegativeDelta.strip()
|
||||
|
@ -19,7 +19,7 @@ class command():
|
||||
def run(self):
|
||||
if self.env['runtime']['inputManager'].noKeyPressed():
|
||||
return
|
||||
if self.env['screenData']['newAttribDelta'] != '':
|
||||
if self.env['screen']['newAttribDelta'] != '':
|
||||
return
|
||||
if self.env['runtime']['screenManager'].isScreenChange():
|
||||
return
|
||||
@ -29,8 +29,8 @@ class command():
|
||||
return
|
||||
if not self.env['input']['currInput'][0] in ['KEY_UP','KEY_DOWN']:
|
||||
return
|
||||
prevLine = self.env['screenData']['oldContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
||||
currLine = self.env['screenData']['newContentText'].split('\n')[self.env['screenData']['newCursor']['y']]
|
||||
prevLine = self.env['screen']['oldContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||
currLine = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
|
||||
if not currLine.isspace():
|
||||
currPrompt = currLine.find('$')
|
||||
rootPrompt = currLine.find('#')
|
||||
|
@ -17,8 +17,8 @@ class command():
|
||||
return 'No Description found'
|
||||
|
||||
def run(self):
|
||||
self.env['runtime']['outputManager'].presentText(_("screen {0}").format(self.env['screenData']['newTTY']),soundIcon='ChangeTTY', interrupt=True, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newContentText'], interrupt=False, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText(_("screen {0}").format(self.env['screen']['newTTY']),soundIcon='ChangeTTY', interrupt=True, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newContentText'], interrupt=False, flush=False)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -26,15 +26,15 @@ class command():
|
||||
|
||||
# its a cursor movement (experimental) - maybe also check current shortcut string?
|
||||
|
||||
#if not '$' in self.env['screenData']['newDelta'] and
|
||||
# not '#' in self.env['screenData']['newDelta']:
|
||||
if abs(self.env['screenData']['newCursor']['x'] - self.env['screenData']['oldCursor']['x']) >= 1:
|
||||
if len(self.env['screenData']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
||||
#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['screenData']['newCursor']['y'] - self.env['screenData']['oldCursor']['y']) == 1:
|
||||
if len(self.env['screenData']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
||||
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['screenData']['newDelta'], interrupt=False, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=False, flush=False)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -22,14 +22,14 @@ class command():
|
||||
return
|
||||
if self.env['runtime']['settingsManager'].getSetting('promote', 'list').strip(" \t\n") == '':
|
||||
return
|
||||
if self.env['screenData']['newDelta'] == '':
|
||||
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['screenData']['newDelta']:
|
||||
if promote in self.env['screen']['newDelta']:
|
||||
self.env['runtime']['outputManager'].playSoundIcon('PromotedText')
|
||||
self.env['input']['lastInputTime'] = time.time()
|
||||
return
|
||||
|
@ -24,12 +24,12 @@ class command():
|
||||
# return
|
||||
|
||||
# its a cursor movement (experimental) - maybe also check current shortcut string?
|
||||
if abs(self.env['screenData']['newCursor']['x'] - self.env['screenData']['oldCursor']['x']) >= 1:
|
||||
if len(self.env['screenData']['newDelta'].strip(' \n\t')) <= 2:
|
||||
if abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']) >= 1:
|
||||
if len(self.env['screen']['newDelta'].strip(' \n\t')) <= 2:
|
||||
return
|
||||
#if abs(self.env['screenData']['newCursor']['y'] - self.env['screenData']['oldCursor']['y']) = 1:
|
||||
#if abs(self.env['screen']['newCursor']['y'] - self.env['screen']['oldCursor']['y']) = 1:
|
||||
# return
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screenData']['newDelta'], interrupt=False, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=False, flush=False)
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -19,14 +19,14 @@ class command():
|
||||
return
|
||||
print('--------------')
|
||||
print('default')
|
||||
print('load new',self.env['screenData']['newApplication'])
|
||||
print('load new',self.env['screen']['newApplication'])
|
||||
print('--------------')
|
||||
|
||||
def unload(self):
|
||||
return
|
||||
print('--------------')
|
||||
print('default')
|
||||
print('unload old',self.env['screenData']['oldApplication'])
|
||||
print('unload old',self.env['screen']['oldApplication'])
|
||||
print('--------------')
|
||||
|
||||
def setCallback(self, callback):
|
||||
|
@ -18,13 +18,13 @@ class command():
|
||||
def load(self):
|
||||
print('--------------')
|
||||
print('agetty')
|
||||
print('load new',self.env['screenData']['newApplication'])
|
||||
print('load new',self.env['screen']['newApplication'])
|
||||
print('--------------')
|
||||
|
||||
def unload(self):
|
||||
print('--------------')
|
||||
print('agetty')
|
||||
print('unload old',self.env['screenData']['oldApplication'])
|
||||
print('unload old',self.env['screen']['oldApplication'])
|
||||
print('--------------')
|
||||
|
||||
def setCallback(self, callback):
|
||||
|
@ -18,13 +18,13 @@ class command():
|
||||
def load(self):
|
||||
print('--------------')
|
||||
print('bash')
|
||||
print('load new',self.env['screenData']['newApplication'])
|
||||
print('load new',self.env['screen']['newApplication'])
|
||||
print('--------------')
|
||||
|
||||
def unload(self):
|
||||
print('--------------')
|
||||
print('bash')
|
||||
print('unload old',self.env['screenData']['oldApplication'])
|
||||
print('unload old',self.env['screen']['oldApplication'])
|
||||
print('--------------')
|
||||
|
||||
def setCallback(self, callback):
|
||||
|
@ -18,13 +18,13 @@ class command():
|
||||
def load(self):
|
||||
print('--------------')
|
||||
print('vim')
|
||||
print('load new',self.env['screenData']['newApplication'])
|
||||
print('load new',self.env['screen']['newApplication'])
|
||||
print('--------------')
|
||||
|
||||
def unload(self):
|
||||
print('--------------')
|
||||
print('vim')
|
||||
print('unload old',self.env['screenData']['oldApplication'])
|
||||
print('unload old',self.env['screen']['oldApplication'])
|
||||
print('--------------')
|
||||
|
||||
def setCallback(self, callback):
|
||||
|
@ -14,18 +14,18 @@ class applicationManager():
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getCurrentApplication(self):
|
||||
currApp = self.env['screenData']['newApplication'].upper()
|
||||
currApp = self.env['screen']['newApplication'].upper()
|
||||
if not currApp:
|
||||
currApp == 'DEFAULT'
|
||||
if currApp == '':
|
||||
currApp == 'DEFAULT'
|
||||
return currApp
|
||||
def getPrevApplication(self):
|
||||
prevApp = self.env['screenData']['oldApplication'].upper()
|
||||
prevApp = self.env['screen']['oldApplication'].upper()
|
||||
if not prevApp:
|
||||
prevApp == 'DEFAULT'
|
||||
if prevApp == '':
|
||||
prevApp == 'DEFAULT'
|
||||
return prevApp
|
||||
def isApplicationChange(self):
|
||||
return self.env['screenData']['oldApplication'] != self.env['screenData']['newApplication']
|
||||
return self.env['screen']['oldApplication'] != self.env['screen']['newApplication']
|
||||
|
@ -15,7 +15,7 @@ class commandManager():
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
# commands
|
||||
for commandFolder in self.env['generalInformation']['commandFolderList']:
|
||||
for commandFolder in self.env['general']['commandFolderList']:
|
||||
self.env['runtime']['commandManager'].loadCommands(commandFolder,
|
||||
self.env['runtime']['settingsManager'].getSetting('general', 'commandPath'))
|
||||
self.env['runtime']['commandManager'].loadCommands(commandFolder)
|
||||
@ -24,7 +24,7 @@ class commandManager():
|
||||
self.env['runtime']['commandManager'].loadScriptCommands()
|
||||
|
||||
def shutdown(self):
|
||||
for commandFolder in self.env['generalInformation']['commandFolderList']:
|
||||
for commandFolder in self.env['general']['commandFolderList']:
|
||||
self.env['runtime']['commandManager'].shutdownCommands(commandFolder)
|
||||
|
||||
def loadCommands(self, section='commands',commandPath=''):
|
||||
@ -180,7 +180,7 @@ class commandManager():
|
||||
return
|
||||
if self.commandExists(command, section):
|
||||
try:
|
||||
if self.env['generalInformation']['tutorialMode']:
|
||||
if self.env['general']['tutorialMode']:
|
||||
self.env['runtime']['debug'].writeDebugOut("Tutorial for command:" + section + "." + command ,debug.debugLevel.INFO)
|
||||
description = self.env['commands'][section][command].getDescription()
|
||||
self.env['runtime']['outputManager'].presentText(description, interrupt=True)
|
||||
|
@ -26,10 +26,10 @@ class cursorManager():
|
||||
self.env['commandBuffer']['Marks']['2'] != None
|
||||
def setMark(self):
|
||||
currCursor = None
|
||||
if self.env['screenData']['newCursorReview']:
|
||||
currCursor = self.env['screenData']['newCursorReview'].copy()
|
||||
if self.env['screen']['newCursorReview']:
|
||||
currCursor = self.env['screen']['newCursorReview'].copy()
|
||||
else:
|
||||
currCursor = self.env['screenData']['newCursor'].copy()
|
||||
currCursor = self.env['screen']['newCursor'].copy()
|
||||
if not self.env['commandBuffer']['Marks']['1']:
|
||||
self.env['commandBuffer']['Marks']['1'] = currCursor.copy()
|
||||
return 1
|
||||
@ -38,43 +38,43 @@ class cursorManager():
|
||||
return 2
|
||||
return 0
|
||||
def getReviewOrTextCursor(self):
|
||||
if self.env['screenData']['newCursorReview']:
|
||||
return self.env['screenData']['newCursorReview'].copy()
|
||||
if self.env['screen']['newCursorReview']:
|
||||
return self.env['screen']['newCursorReview'].copy()
|
||||
else:
|
||||
return self.env['screenData']['newCursor'].copy()
|
||||
return self.env['screen']['newCursor'].copy()
|
||||
def clearReviewCursor(self):
|
||||
if not self.isReviewMode():
|
||||
return
|
||||
self.env['screenData']['oldCursorReview'] = None
|
||||
self.env['screenData']['newCursorReview'] = None
|
||||
self.env['screen']['oldCursorReview'] = None
|
||||
self.env['screen']['newCursorReview'] = None
|
||||
|
||||
def isCursorHorizontalMove(self):
|
||||
return self.env['screenData']['newCursor']['x'] != self.env['screenData']['oldCursor']['x']
|
||||
return self.env['screen']['newCursor']['x'] != self.env['screen']['oldCursor']['x']
|
||||
|
||||
def isCursorVerticalMove(self):
|
||||
return self.env['screenData']['newCursor']['y'] != self.env['screenData']['oldCursor']['y']
|
||||
return self.env['screen']['newCursor']['y'] != self.env['screen']['oldCursor']['y']
|
||||
|
||||
def isReviewMode(self):
|
||||
return self.env['screenData']['newCursorReview'] != None
|
||||
return self.env['screen']['newCursorReview'] != None
|
||||
|
||||
def enterReviewModeCurrTextCursor(self, overwrite=False):
|
||||
if self.isReviewMode() and not overwrite:
|
||||
return
|
||||
self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview']
|
||||
if not self.env['screenData']['newCursorReview']:
|
||||
self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursor'].copy()
|
||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
||||
if not self.env['screen']['newCursorReview']:
|
||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
||||
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight') and \
|
||||
self.env['screenData']['newCursorAttrib'] != None:
|
||||
if self.env['screenData']['newCursorAttrib']['x'] != 0 and \
|
||||
self.env['screenData']['newCursorAttrib']['y'] != 0:
|
||||
self.env['screenData']['newCursorReview'] = self.env['screenData']['newCursorAttrib'].copy()
|
||||
self.env['screen']['newCursorAttrib'] != None:
|
||||
if self.env['screen']['newCursorAttrib']['x'] != 0 and \
|
||||
self.env['screen']['newCursorAttrib']['y'] != 0:
|
||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursorAttrib'].copy()
|
||||
|
||||
def setReviewCursorPosition(self, x, y):
|
||||
if not self.isReviewMode():
|
||||
self.enterReviewModeCurrTextCursor()
|
||||
self.env['screenData']['oldCursorReview'] = self.env['screenData']['newCursorReview']
|
||||
self.env['screenData']['newCursorReview']['x'] = x
|
||||
self.env['screenData']['newCursorReview']['y'] = y
|
||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
||||
self.env['screen']['newCursorReview']['x'] = x
|
||||
self.env['screen']['newCursorReview']['y'] = y
|
||||
|
||||
def isApplicationWindowSet(self):
|
||||
try:
|
||||
|
@ -5,27 +5,27 @@
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
from core import settings
|
||||
from core import runtime
|
||||
from core import screenData
|
||||
from core import output
|
||||
from core import generalInformation
|
||||
from core import commands
|
||||
from core import inputEvent
|
||||
from core import punctuation
|
||||
from core.settingsData import settingsData
|
||||
from core.runtimeData import runtimeData
|
||||
from core.screenData import screenData
|
||||
from core.outputData import outputData
|
||||
from core.generalData import generalData
|
||||
from core import commandData
|
||||
from core.inputData import inputData
|
||||
from core.punctuationData import punctuationData
|
||||
|
||||
environment = {
|
||||
'screenData': screenData.screenData,
|
||||
'runtime': runtime.runtime,
|
||||
'generalInformation': generalInformation.generalInformation,
|
||||
'settings': settings.settings,
|
||||
'commands': commands.commands,
|
||||
'commandsIgnore': commands.commandsIgnore,
|
||||
'commandInfo': commands.commandInfo,
|
||||
'commandBuffer': commands.commandBuffer,
|
||||
'input': inputEvent.input,
|
||||
'punctuation': punctuation.punctuation,
|
||||
'output': output.output,
|
||||
'screen': screenData,
|
||||
'runtime': runtimeData,
|
||||
'general': generalData,
|
||||
'settings': settingsData,
|
||||
'commands': commandData.commands,
|
||||
'commandsIgnore': commandData.commandsIgnore,
|
||||
'commandInfo': commandData.commandInfo,
|
||||
'commandBuffer': commandData.commandBuffer,
|
||||
'input': inputData,
|
||||
'punctuation': punctuationData,
|
||||
'output': outputData,
|
||||
'soundIcons': {},
|
||||
'bindings': {},
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ class eventManager():
|
||||
except Exception as e:
|
||||
print(e)
|
||||
self.putToEventQueue(event, Data)
|
||||
|
||||
'''
|
||||
def p():
|
||||
time.sleep(0.02)
|
||||
return("p")
|
||||
@ -122,4 +122,4 @@ e.addEventThread(fenrirEventType.StopMainLoop,e.stopMainEventLoop)
|
||||
s = time.time()
|
||||
e.startMainEventLoop()
|
||||
print(time.time() - s )
|
||||
|
||||
'''
|
||||
|
@ -28,7 +28,7 @@ class fenrirManager():
|
||||
self.wasCommand = False
|
||||
|
||||
def proceed(self):
|
||||
while(self.environment['generalInformation']['running']):
|
||||
while(self.environment['general']['running']):
|
||||
try:
|
||||
self.handleProcess()
|
||||
except Exception as e:
|
||||
@ -43,13 +43,13 @@ class fenrirManager():
|
||||
self.environment['runtime']['inputManager'].updateInputDevices()
|
||||
if eventReceived:
|
||||
self.prepareCommand()
|
||||
if not (self.wasCommand or self.environment['generalInformation']['tutorialMode']) or self.environment['runtime']['screenManager'].isSuspendingScreen():
|
||||
if not (self.wasCommand or self.environment['general']['tutorialMode']) or self.environment['runtime']['screenManager'].isSuspendingScreen():
|
||||
self.environment['runtime']['inputManager'].writeEventBuffer()
|
||||
if self.environment['runtime']['inputManager'].noKeyPressed():
|
||||
if self.wasCommand:
|
||||
self.wasCommand = False
|
||||
self.environment['runtime']['inputManager'].clearEventBuffer()
|
||||
if self.environment['generalInformation']['tutorialMode']:
|
||||
if self.environment['general']['tutorialMode']:
|
||||
self.environment['runtime']['inputManager'].clearEventBuffer()
|
||||
if self.environment['input']['keyForeward'] > 0:
|
||||
self.environment['input']['keyForeward'] -=1
|
||||
@ -94,14 +94,14 @@ class fenrirManager():
|
||||
self.environment['runtime']['commandManager'].executeCommand( self.environment['commandInfo']['currCommand'], 'commands')
|
||||
|
||||
def shutdownRequest(self):
|
||||
self.environment['generalInformation']['running'] = False
|
||||
self.environment['general']['running'] = False
|
||||
|
||||
def captureSignal(self, siginit, frame):
|
||||
self.shutdownRequest()
|
||||
|
||||
def shutdown(self):
|
||||
self.environment['runtime']['outputManager'].presentText(_("Quit Fenrir"), soundIcon='ScreenReaderOff', interrupt=True)
|
||||
for currManager in self.environment['generalInformation']['managerList']:
|
||||
for currManager in self.environment['general']['managerList']:
|
||||
if self.environment['runtime'][currManager]:
|
||||
self.environment['runtime'][currManager].shutdown()
|
||||
del self.environment['runtime'][currManager]
|
||||
|
@ -6,12 +6,12 @@
|
||||
|
||||
from core import debug
|
||||
|
||||
generalInformation = {
|
||||
generalData = {
|
||||
'running': True,
|
||||
'tutorialMode': False,
|
||||
'currUser':'',
|
||||
'prevUser':'',
|
||||
'managerList':['punctuationManager','cursorManager','applicationManager','commandManager'
|
||||
'managerList':['eventManager','punctuationManager','cursorManager','applicationManager','commandManager'
|
||||
,'screenManager','inputManager','outputManager','debug'],
|
||||
'commandFolderList':['commands','onInput','onScreenUpdate','onScreenChanged'
|
||||
,'onApplicationChange','onSwitchApplicationProfile',],
|
File diff suppressed because one or more lines are too long
@ -6,7 +6,6 @@
|
||||
|
||||
import time
|
||||
from core import debug
|
||||
from core import inputEvent
|
||||
|
||||
class inputManager():
|
||||
def __init__(self):
|
||||
|
@ -7,7 +7,7 @@
|
||||
import time
|
||||
from core import debug
|
||||
|
||||
output = {
|
||||
outputData = {
|
||||
'nextFlush': time.time(),
|
||||
'messageText': '',
|
||||
'messageOffset': None,
|
@ -119,8 +119,8 @@ class outputManager():
|
||||
self.env['output']['messageOffset'] = None
|
||||
cursor = self.getBrailleCursor()
|
||||
x, y, self.env['output']['brlText'] = \
|
||||
line_utils.getCurrentLine(cursor['x'], cursor['y'], self.env['screenData']['newContentText'])
|
||||
displayText = self.getBrailleTextWithOffset(self.env['screenData']['newContentText'], self.env['output']['cursorOffset'], cursor)
|
||||
line_utils.getCurrentLine(cursor['x'], cursor['y'], self.env['screen']['newContentText'])
|
||||
displayText = self.getBrailleTextWithOffset(self.env['screen']['newContentText'], self.env['output']['cursorOffset'], cursor)
|
||||
self.env['runtime']['brailleDriver'].writeText('notflush'+displayText)
|
||||
else:
|
||||
displayText = self.getBrailleTextWithOffset(self.env['output']['messageText'], self.env['output']['messageOffset'])
|
||||
@ -147,8 +147,8 @@ class outputManager():
|
||||
if self.env['output']['messageOffset']:
|
||||
return self.env['output']['messageOffset'], self.env['output']['messageText']
|
||||
if not self.env['output']['cursorOffset']:
|
||||
return self.getBrailleCursor(), self.env['screenData']['newContentText']
|
||||
return self.env['output']['cursorOffset'], self.env['screenData']['newContentText']
|
||||
return self.getBrailleCursor(), self.env['screen']['newContentText']
|
||||
return self.env['output']['cursorOffset'], self.env['screen']['newContentText']
|
||||
def getHorizontalPanSize(self):
|
||||
size = self.env['runtime']['brailleDriver'].getDeviceSize()
|
||||
if self.env['runtime']['settingsManager'].getSettingAsInt('braille', 'panSizeHorizontal') <= 0:
|
||||
|
@ -7,7 +7,7 @@
|
||||
from core import debug
|
||||
import string
|
||||
|
||||
punctuation = {
|
||||
punctuationData = {
|
||||
'LEVELDICT':{
|
||||
'none': '',
|
||||
'some': '#-$~+*-/\\@',
|
@ -6,7 +6,7 @@
|
||||
|
||||
from core import debug
|
||||
|
||||
runtime = {
|
||||
runtimeData = {
|
||||
'speechDriver': None,
|
||||
'screenDriver': None,
|
||||
'soundDriver': None,
|
@ -23,35 +23,35 @@ class screenManager():
|
||||
def update(self, trigger='onUpdate'):
|
||||
self.env['runtime']['screenDriver'].getCurrScreen()
|
||||
self.env['runtime']['screenDriver'].getSessionInformation()
|
||||
self.env['screenData']['oldApplication'] = self.env['screenData']['newApplication']
|
||||
self.env['screen']['oldApplication'] = self.env['screen']['newApplication']
|
||||
if self.isScreenChange():
|
||||
self.changeBrailleScreen()
|
||||
if not self.isSuspendingScreen(self.env['screenData']['newTTY']):
|
||||
if not self.isSuspendingScreen(self.env['screen']['newTTY']):
|
||||
self.env['runtime']['screenDriver'].update(trigger)
|
||||
if trigger == 'onUpdate' or self.isScreenChange() \
|
||||
or len(self.env['screenData']['newDelta']) > 6:
|
||||
or len(self.env['screen']['newDelta']) > 6:
|
||||
self.env['runtime']['screenDriver'].getCurrApplication()
|
||||
self.env['screenData']['lastScreenUpdate'] = time.time()
|
||||
self.env['screen']['lastScreenUpdate'] = time.time()
|
||||
|
||||
def isSuspendingScreen(self, screen = None):
|
||||
if screen == None:
|
||||
screen = self.env['screenData']['newTTY']
|
||||
screen = self.env['screen']['newTTY']
|
||||
ignoreScreens = []
|
||||
fixIgnoreScreens = self.env['runtime']['settingsManager'].getSetting('screen', 'suspendingScreen')
|
||||
if fixIgnoreScreens != '':
|
||||
ignoreScreens.extend(fixIgnoreScreens.split(','))
|
||||
if self.env['runtime']['settingsManager'].getSettingAsBool('screen', 'autodetectSuspendingScreen'):
|
||||
ignoreScreens.extend(self.env['screenData']['autoIgnoreScreens'])
|
||||
ignoreScreens.extend(self.env['screen']['autoIgnoreScreens'])
|
||||
return (screen in ignoreScreens)
|
||||
|
||||
def isScreenChange(self):
|
||||
if not self.env['screenData']['oldTTY']:
|
||||
if not self.env['screen']['oldTTY']:
|
||||
return False
|
||||
return self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']
|
||||
return self.env['screen']['newTTY'] != self.env['screen']['oldTTY']
|
||||
def isDelta(self):
|
||||
return self.env['screenData']['newDelta'] != ''
|
||||
return self.env['screen']['newDelta'] != ''
|
||||
def isNegativeDelta(self):
|
||||
return self.env['screenData']['newNegativeDelta'] != ''
|
||||
return self.env['screen']['newNegativeDelta'] != ''
|
||||
def getWindowAreaInText(self, text):
|
||||
if not self.env['runtime']['cursorManager'].isApplicationWindowSet():
|
||||
return text
|
||||
@ -74,14 +74,14 @@ class screenManager():
|
||||
return
|
||||
if not self.env['runtime']['brailleDriver']:
|
||||
return
|
||||
if self.env['screenData']['oldTTY']:
|
||||
if not self.isSuspendingScreen(self.env['screenData']['oldTTY']):
|
||||
if self.env['screen']['oldTTY']:
|
||||
if not self.isSuspendingScreen(self.env['screen']['oldTTY']):
|
||||
try:
|
||||
self.env['runtime']['brailleDriver'].leveScreen()
|
||||
except Exception as e:
|
||||
self.env['runtime']['debug'].writeDebugOut('screenManager:changeBrailleScreen:leveScreen ' + str(e),debug.debugLevel.ERROR)
|
||||
if not self.isSuspendingScreen():
|
||||
try:
|
||||
self.env['runtime']['brailleDriver'].enterScreen(self.env['screenData']['newTTY'])
|
||||
self.env['runtime']['brailleDriver'].enterScreen(self.env['screen']['newTTY'])
|
||||
except Exception as e:
|
||||
self.env['runtime']['debug'].writeDebugOut('screenManager:changeBrailleScreen:enterScreen ' + str(e),debug.debugLevel.ERROR)
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
from core import debug
|
||||
|
||||
settings = {
|
||||
settingsData = {
|
||||
'sound': {
|
||||
'enabled': True,
|
||||
'driver': 'genericDriver',
|
@ -7,6 +7,7 @@
|
||||
import os
|
||||
import __main__
|
||||
from configparser import ConfigParser
|
||||
from core import eventManager
|
||||
from core import inputManager
|
||||
from core import outputManager
|
||||
from core import commandManager
|
||||
@ -15,14 +16,14 @@ from core import punctuationManager
|
||||
from core import cursorManager
|
||||
from core import applicationManager
|
||||
from core import environment
|
||||
from core import inputEvent
|
||||
from core.settings import settings
|
||||
from core import inputData
|
||||
from core.settingsData import settingsData
|
||||
from core import debug
|
||||
from utils import module_utils
|
||||
|
||||
class settingsManager():
|
||||
def __init__(self):
|
||||
self.settings = settings
|
||||
self.settings = settingsData
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
@ -99,7 +100,7 @@ class settingsManager():
|
||||
self.env['runtime']['debug'].writeDebugOut("SoundIcon: " + soundIcon + '.' + soundIconFile, debug.debugLevel.INFO, onAnyLevel=True)
|
||||
siConfig.close()
|
||||
def isValidKey(self, key):
|
||||
return key in inputEvent.keyNames
|
||||
return key in inputData.keyNames
|
||||
|
||||
def loadDicts(self, dictConfigPath=os.path.dirname(os.path.realpath(__main__.__file__)) + '/../../config/punctuation/default.conf'):
|
||||
dictConfig = open(dictConfigPath,"r")
|
||||
@ -255,6 +256,8 @@ class settingsManager():
|
||||
else:
|
||||
environment['runtime']['settingsManager'].loadDicts(self.getSetting('general','punctuationProfile'))
|
||||
|
||||
environment['runtime']['eventManager'] = eventManager.eventManager()
|
||||
environment['runtime']['eventManager'].initialize(environment)
|
||||
environment['runtime']['inputManager'] = inputManager.inputManager()
|
||||
environment['runtime']['inputManager'].initialize(environment)
|
||||
environment['runtime']['outputManager'] = outputManager.outputManager()
|
||||
|
@ -15,7 +15,7 @@ except Exception as e:
|
||||
|
||||
import time
|
||||
from select import select
|
||||
from core import inputEvent
|
||||
from core import inputData
|
||||
from core import debug
|
||||
|
||||
class driver():
|
||||
@ -153,7 +153,7 @@ class driver():
|
||||
return None
|
||||
if not event:
|
||||
return None
|
||||
mEvent = inputEvent.inputEvent
|
||||
mEvent = inputData.inputEvent
|
||||
try:
|
||||
mEvent['EventName'] = evdev.ecodes.keys[event.code]
|
||||
mEvent['EventValue'] = event.code
|
||||
|
@ -23,15 +23,15 @@ class driver():
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getCurrScreen(self):
|
||||
self.env['screenData']['oldTTY'] = self.env['screenData']['newTTY']
|
||||
self.env['screen']['oldTTY'] = self.env['screen']['newTTY']
|
||||
try:
|
||||
currScreenFile = open('/sys/devices/virtual/tty/tty0/active','r')
|
||||
self.env['screenData']['newTTY'] = str(currScreenFile.read()[3:-1])
|
||||
self.env['screen']['newTTY'] = str(currScreenFile.read()[3:-1])
|
||||
currScreenFile.close()
|
||||
except Exception as e:
|
||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||
def injectTextToScreen(self, text, screen = None):
|
||||
useScreen = "/dev/tty" + self.env['screenData']['newTTY']
|
||||
useScreen = "/dev/tty" + self.env['screen']['newTTY']
|
||||
if screen != None:
|
||||
useScreen = screen
|
||||
with open(useScreen, 'w') as fd:
|
||||
@ -41,7 +41,7 @@ class driver():
|
||||
def getCurrApplication(self):
|
||||
apps = []
|
||||
try:
|
||||
currScreen = self.env['screenData']['newTTY']
|
||||
currScreen = self.env['screen']['newTTY']
|
||||
apps = subprocess.Popen('ps -t tty' + currScreen + ' -o comm,tty,stat', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n')
|
||||
except Exception as e:
|
||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||
@ -58,8 +58,8 @@ class driver():
|
||||
not "SH" == i[0] and \
|
||||
not "PS" == i[0]:
|
||||
if "TTY"+currScreen in i[1]:
|
||||
if self.env['screenData']['newApplication'] != i[0]:
|
||||
self.env['screenData']['newApplication'] = i[0]
|
||||
if self.env['screen']['newApplication'] != i[0]:
|
||||
self.env['screen']['newApplication'] = i[0]
|
||||
return
|
||||
except Exception as e:
|
||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
||||
@ -72,7 +72,7 @@ class driver():
|
||||
self.ListSessions = inf.get_dbus_method('ListSessions')
|
||||
|
||||
sessions = self.ListSessions()
|
||||
self.env['screenData']['autoIgnoreScreens'] = []
|
||||
self.env['screen']['autoIgnoreScreens'] = []
|
||||
for session in sessions:
|
||||
obj = bus.get_object('org.freedesktop.login1', session[4])
|
||||
inf = dbus.Interface(obj, 'org.freedesktop.DBus.Properties')
|
||||
@ -85,17 +85,17 @@ class driver():
|
||||
self.env['runtime']['debug'].writeDebugOut('No TTY found for session:' + session[4],debug.debugLevel.ERROR)
|
||||
return
|
||||
if sessionType.upper() == 'X11':
|
||||
self.env['screenData']['autoIgnoreScreens'].append(screen)
|
||||
if screen == self.env['screenData']['newTTY'] :
|
||||
if self.env['generalInformation']['currUser'] != session[2]:
|
||||
self.env['generalInformation']['prevUser'] = self.env['generalInformation']['currUser']
|
||||
self.env['generalInformation']['currUser'] = session[2]
|
||||
self.env['screen']['autoIgnoreScreens'].append(screen)
|
||||
if screen == self.env['screen']['newTTY'] :
|
||||
if self.env['general']['currUser'] != session[2]:
|
||||
self.env['general']['prevUser'] = self.env['general']['currUser']
|
||||
self.env['general']['currUser'] = session[2]
|
||||
|
||||
def update(self, trigger='onUpdate'):
|
||||
newContentBytes = b''
|
||||
try:
|
||||
# read screen
|
||||
vcsa = open(self.vcsaDevicePath + self.env['screenData']['newTTY'],'rb',0)
|
||||
vcsa = open(self.vcsaDevicePath + self.env['screen']['newTTY'],'rb',0)
|
||||
newContentBytes = vcsa.read()
|
||||
vcsa.close()
|
||||
if len(newContentBytes) < 5:
|
||||
@ -105,62 +105,62 @@ class driver():
|
||||
return
|
||||
screenEncoding = self.env['runtime']['settingsManager'].getSetting('screen', 'encoding')
|
||||
# set new "old" values
|
||||
self.env['screenData']['oldContentBytes'] = self.env['screenData']['newContentBytes']
|
||||
self.env['screenData']['oldContentText'] = self.env['screenData']['newContentText']
|
||||
self.env['screenData']['oldContentAttrib'] = self.env['screenData']['newContentAttrib']
|
||||
self.env['screenData']['oldCursor'] = self.env['screenData']['newCursor'].copy()
|
||||
if self.env['screenData']['newCursorAttrib']:
|
||||
self.env['screenData']['oldCursorAttrib'] = self.env['screenData']['newCursorAttrib'].copy()
|
||||
self.env['screenData']['oldDelta'] = self.env['screenData']['newDelta']
|
||||
self.env['screenData']['oldAttribDelta'] = self.env['screenData']['newAttribDelta']
|
||||
self.env['screenData']['oldNegativeDelta'] = self.env['screenData']['newNegativeDelta']
|
||||
self.env['screenData']['newContentBytes'] = newContentBytes
|
||||
self.env['screen']['oldContentBytes'] = self.env['screen']['newContentBytes']
|
||||
self.env['screen']['oldContentText'] = self.env['screen']['newContentText']
|
||||
self.env['screen']['oldContentAttrib'] = self.env['screen']['newContentAttrib']
|
||||
self.env['screen']['oldCursor'] = self.env['screen']['newCursor'].copy()
|
||||
if self.env['screen']['newCursorAttrib']:
|
||||
self.env['screen']['oldCursorAttrib'] = self.env['screen']['newCursorAttrib'].copy()
|
||||
self.env['screen']['oldDelta'] = self.env['screen']['newDelta']
|
||||
self.env['screen']['oldAttribDelta'] = self.env['screen']['newAttribDelta']
|
||||
self.env['screen']['oldNegativeDelta'] = self.env['screen']['newNegativeDelta']
|
||||
self.env['screen']['newContentBytes'] = newContentBytes
|
||||
# get metadata like cursor or screensize
|
||||
self.env['screenData']['lines'] = int( self.env['screenData']['newContentBytes'][0])
|
||||
self.env['screenData']['columns'] = int( self.env['screenData']['newContentBytes'][1])
|
||||
self.env['screenData']['newCursor']['x'] = int( self.env['screenData']['newContentBytes'][2])
|
||||
self.env['screenData']['newCursor']['y'] = int( self.env['screenData']['newContentBytes'][3])
|
||||
self.env['screen']['lines'] = int( self.env['screen']['newContentBytes'][0])
|
||||
self.env['screen']['columns'] = int( self.env['screen']['newContentBytes'][1])
|
||||
self.env['screen']['newCursor']['x'] = int( self.env['screen']['newContentBytes'][2])
|
||||
self.env['screen']['newCursor']['y'] = int( self.env['screen']['newContentBytes'][3])
|
||||
# analyze content
|
||||
self.env['screenData']['newContentText'] = self.env['screenData']['newContentBytes'][4:][::2].decode(screenEncoding, "replace").encode('utf-8').decode('utf-8')
|
||||
self.env['screenData']['newContentText'] = screen_utils.removeNonprintable(self.env['screenData']['newContentText'])
|
||||
self.env['screenData']['newContentAttrib'] = self.env['screenData']['newContentBytes'][5:][::2]
|
||||
self.env['screenData']['newContentText'] = screen_utils.insertNewlines(self.env['screenData']['newContentText'], self.env['screenData']['columns'])
|
||||
self.env['screen']['newContentText'] = self.env['screen']['newContentBytes'][4:][::2].decode(screenEncoding, "replace").encode('utf-8').decode('utf-8')
|
||||
self.env['screen']['newContentText'] = screen_utils.removeNonprintable(self.env['screen']['newContentText'])
|
||||
self.env['screen']['newContentAttrib'] = self.env['screen']['newContentBytes'][5:][::2]
|
||||
self.env['screen']['newContentText'] = screen_utils.insertNewlines(self.env['screen']['newContentText'], self.env['screen']['columns'])
|
||||
|
||||
if self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']:
|
||||
self.env['screenData']['oldContentBytes'] = b''
|
||||
self.env['screenData']['oldContentAttrib'] = b''
|
||||
self.env['screenData']['oldContentText'] = ''
|
||||
self.env['screenData']['oldCursor']['x'] = 0
|
||||
self.env['screenData']['oldCursor']['y'] = 0
|
||||
self.env['screenData']['oldDelta'] = ''
|
||||
self.env['screenData']['oldAttribDelta'] = ''
|
||||
self.env['screenData']['oldCursorAttrib'] = None
|
||||
self.env['screenData']['newCursorAttrib'] = None
|
||||
self.env['screenData']['oldNegativeDelta'] = ''
|
||||
if self.env['screen']['newTTY'] != self.env['screen']['oldTTY']:
|
||||
self.env['screen']['oldContentBytes'] = b''
|
||||
self.env['screen']['oldContentAttrib'] = b''
|
||||
self.env['screen']['oldContentText'] = ''
|
||||
self.env['screen']['oldCursor']['x'] = 0
|
||||
self.env['screen']['oldCursor']['y'] = 0
|
||||
self.env['screen']['oldDelta'] = ''
|
||||
self.env['screen']['oldAttribDelta'] = ''
|
||||
self.env['screen']['oldCursorAttrib'] = None
|
||||
self.env['screen']['newCursorAttrib'] = None
|
||||
self.env['screen']['oldNegativeDelta'] = ''
|
||||
# initialize current deltas
|
||||
self.env['screenData']['newNegativeDelta'] = ''
|
||||
self.env['screenData']['newDelta'] = ''
|
||||
self.env['screenData']['newAttribDelta'] = ''
|
||||
self.env['screen']['newNegativeDelta'] = ''
|
||||
self.env['screen']['newDelta'] = ''
|
||||
self.env['screen']['newAttribDelta'] = ''
|
||||
|
||||
# changes on the screen
|
||||
oldScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screenData']['oldContentText']))
|
||||
newScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screenData']['newContentText']))
|
||||
oldScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['oldContentText']))
|
||||
newScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['newContentText']))
|
||||
typing = False
|
||||
if (self.env['screenData']['oldContentText'] != self.env['screenData']['newContentText']) and \
|
||||
(self.env['screenData']['newContentText'] != '' ):
|
||||
if (self.env['screen']['oldContentText'] != self.env['screen']['newContentText']) and \
|
||||
(self.env['screen']['newContentText'] != '' ):
|
||||
if oldScreenText == '' and\
|
||||
newScreenText != '':
|
||||
self.env['screenData']['newDelta'] = newScreenText
|
||||
self.env['screen']['newDelta'] = newScreenText
|
||||
else:
|
||||
cursorLineStart = self.env['screenData']['newCursor']['y'] * self.env['screenData']['columns'] + self.env['screenData']['newCursor']['y']
|
||||
cursorLineEnd = cursorLineStart + self.env['screenData']['columns']
|
||||
if self.env['screenData']['oldCursor']['x'] != self.env['screenData']['newCursor']['x'] and \
|
||||
self.env['screenData']['oldCursor']['y'] == self.env['screenData']['newCursor']['y'] and \
|
||||
self.env['screenData']['newContentText'][:cursorLineStart] == self.env['screenData']['oldContentText'][:cursorLineStart]:
|
||||
cursorLineStart = self.env['screen']['newCursor']['y'] * self.env['screen']['columns'] + self.env['screen']['newCursor']['y']
|
||||
cursorLineEnd = cursorLineStart + self.env['screen']['columns']
|
||||
if self.env['screen']['oldCursor']['x'] != self.env['screen']['newCursor']['x'] and \
|
||||
self.env['screen']['oldCursor']['y'] == self.env['screen']['newCursor']['y'] and \
|
||||
self.env['screen']['newContentText'][:cursorLineStart] == self.env['screen']['oldContentText'][:cursorLineStart]:
|
||||
|
||||
oldScreenText = self.env['screenData']['oldContentText'][cursorLineStart:cursorLineEnd]
|
||||
oldScreenText = self.env['screen']['oldContentText'][cursorLineStart:cursorLineEnd]
|
||||
oldScreenText = re.sub(' +',' ',oldScreenText)
|
||||
newScreenText = self.env['screenData']['newContentText'][cursorLineStart:cursorLineEnd]
|
||||
newScreenText = self.env['screen']['newContentText'][cursorLineStart:cursorLineEnd]
|
||||
newScreenText = re.sub(' +',' ',newScreenText)
|
||||
diff = difflib.ndiff(oldScreenText, newScreenText)
|
||||
typing = True
|
||||
@ -171,13 +171,13 @@ class driver():
|
||||
diffList = list(diff)
|
||||
|
||||
if self.env['runtime']['settingsManager'].getSetting('general', 'newLinePause') and not typing:
|
||||
self.env['screenData']['newDelta'] = '\n'.join(x[2:] for x in diffList if x[0] == '+')
|
||||
self.env['screen']['newDelta'] = '\n'.join(x[2:] for x in diffList if x[0] == '+')
|
||||
else:
|
||||
self.env['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x[0] == '+')
|
||||
self.env['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x[0] == '-')
|
||||
self.env['screen']['newDelta'] = ''.join(x[2:] for x in diffList if x[0] == '+')
|
||||
self.env['screen']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x[0] == '-')
|
||||
|
||||
# track highlighted
|
||||
if self.env['screenData']['oldContentAttrib'] != self.env['screenData']['newContentAttrib']:
|
||||
if self.env['screen']['oldContentAttrib'] != self.env['screen']['newContentAttrib']:
|
||||
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
|
||||
self.env['screenData']['newAttribDelta'], self.env['screenData']['newCursorAttrib'] = screen_utils.trackHighlights(self.env['screenData']['oldContentAttrib'], self.env['screenData']['newContentAttrib'], self.env['screenData']['newContentText'], self.env['screenData']['columns'])
|
||||
self.env['screen']['newAttribDelta'], self.env['screen']['newCursorAttrib'] = screen_utils.trackHighlights(self.env['screen']['oldContentAttrib'], self.env['screen']['newContentAttrib'], self.env['screen']['newContentText'], self.env['screen']['columns'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user