sync with my repo

This commit is contained in:
chrys 2016-10-18 15:25:55 +02:00
parent bd4cbce395
commit 3f0d8ea671
2 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,36 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
from utils import word_utils
from utils import char_utils
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'phonetically spells the current word and set review to it'
def run(self):
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], nextWord = \
word_utils.getNextWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
if nextWord.isspace():
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
else:
firstSequence = True
for c in nextWord:
currChar = char_utils.getPhonetic(c)
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True)
firstSequence = False
def setCallback(self, callback):
pass

View File

@ -0,0 +1,36 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
from utils import word_utils
from utils import char_utils
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'phonetically spells the current word and set review to it'
def run(self):
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], prevWord = \
word_utils.getPrevWord(self.env['screenData']['newCursorReview']['x'], self.env['screenData']['newCursorReview']['y'], self.env['screenData']['newContentText'])
if prevWord.isspace():
self.env['runtime']['outputManager'].presentText("blank", interrupt=True)
else:
firstSequence = True
for c in prevWord:
currChar = char_utils.getPhonetic(c)
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True)
firstSequence = False
def setCallback(self, callback):
pass