announce content of begin/end of line

This commit is contained in:
chrys
2016-10-02 16:38:52 +02:00
parent 3eb5fb0f47
commit c6562281da
6 changed files with 31 additions and 16 deletions

View File

@ -1,11 +1,11 @@
#!/bin/python
from utils import char_utils
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
from utils import char_utils
class command():
def __init__(self):

View File

@ -5,6 +5,7 @@
# By Chrys, Storm Dragon, and contributers.
from core import debug
from utils import char_utils
class command():
def __init__(self):
@ -14,12 +15,19 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'displays the position of the review cursor'
return 'set review cursor to begin of current line and display the content'
def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
self.env['runtime']['cursorManager'].setReviewCursorPosition(0 ,cursorPos['y'])
self.env['runtime']['outputManager'].presentText("begin of line", interrupt=True)
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'])
if currChar.strip(" \t\n") == '':
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
self.env['runtime']['outputManager'].presentText("begin of line", interrupt=False)
def setCallback(self, callback):
pass

View File

@ -5,6 +5,7 @@
# By Chrys, Storm Dragon, and contributers.
from core import debug
from utils import char_utils
class command():
def __init__(self):
@ -14,12 +15,19 @@ class command():
def shutdown(self):
pass
def getDescription(self):
return 'displays the position of the review cursor'
return 'set review cursor to end of current line and display the content'
def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
self.env['runtime']['cursorManager'].setReviewCursorPosition(self.env['screenData']['columns']-1 ,cursorPos['y'])
self.env['runtime']['outputManager'].presentText("end of line", interrupt=True)
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'])
if currChar.strip(" \t\n") == '':
self.env['runtime']['outputManager'].presentText("blank" ,interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True)
self.env['runtime']['outputManager'].presentText("end of line", interrupt=False)
def setCallback(self, callback):
pass

View File

@ -57,7 +57,6 @@ class settingsManager():
kbConfig.close()
def loadSoundIcons(self, soundIconPath):
print(soundIconPath + '/soundicons.conf')
siConfig = open(soundIconPath + '/soundicons.conf',"r")
while(True):
line = siConfig.readline()