To make Fenrir easier to approach for new developer, start code migration to be pep8 compliant.

This commit is contained in:
Storm Dragon
2025-07-01 22:23:50 -04:00
parent 4bcf82178e
commit 7408951152
345 changed files with 8688 additions and 3852 deletions

View File

@@ -5,34 +5,47 @@
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core.i18n import _
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'No Description found'
def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
if not self.env['runtime']['settingsManager'].getSettingAsBool(
'speech', 'autoReadIncoming'):
return
# is there something to read?
if not self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
return
# this must be a keyecho or something
#if len(self.env['screen']['newDelta'].strip(' \n\t')) <= 1:
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
yMove = abs(self.env['screen']['newCursor']['y'] - self.env['screen']['oldCursor']['y'])
# if len(self.env['screen']['newDelta'].strip(' \n\t')) <= 1:
xMove = abs(
self.env['screen']['newCursor']['x'] -
self.env['screen']['oldCursor']['x'])
yMove = abs(
self.env['screen']['newCursor']['y'] -
self.env['screen']['oldCursor']['y'])
if (xMove >= 1) and xMove == len(self.env['screen']['newDelta']):
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
if not '\n' in self.env['screen']['newDelta']:
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789'))
# <= 2:
if '\n' not in self.env['screen']['newDelta']:
return
#print(xMove, yMove, len(self.env['screen']['newDelta']), len(self.env['screen']['newNegativeDelta']))
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=False, flush=False)
# print(xMove, yMove, len(self.env['screen']['newDelta']), len(self.env['screen']['newNegativeDelta']))
self.env['runtime']['outputManager'].presentText(
self.env['screen']['newDelta'], interrupt=False, flush=False)
def setCallback(self, callback):
pass