17 Commits

Author SHA1 Message Date
9c45ca1b5f Fixed bug in Fenrir configuration tool. 2024-12-21 17:46:23 -05:00
bc4319bf5e Forgot to get rid of the scm stuff since moving back to setup.py. 2024-12-20 14:08:25 -05:00
1d746eb709 Minimal pyproject.tmol added. 2024-12-20 12:30:56 -05:00
80f549fde9 Hopefully final fix to setup. 2024-12-20 12:24:52 -05:00
9f57f7faec Revert back to setup.py because it worked. 2024-12-20 12:19:09 -05:00
099d49d670 maybe was over complicating things. 2024-12-20 12:00:23 -05:00
67b6c79678 Trying some debugging to figure out what's going wrong. 2024-12-20 11:43:43 -05:00
191181a6a5 This modern installation method is turning out to be a pita. 2024-12-20 11:32:26 -05:00
c77d2bddd8 Second attempt at placing files into correct directories. 2024-12-20 11:22:09 -05:00
90d8e62db0 Fixed a bug in setup.py. 2024-12-20 11:09:32 -05:00
d6a9332f80 Modernize installation. 2024-12-20 11:04:13 -05:00
55ce73322b File restructuring. 2024-12-20 10:09:07 -05:00
78ca59a938 Found non working unused python directory. Can add it back if needed. 2024-12-20 09:42:47 -05:00
dd52d08171 Copy translation files into place with setup. 2024-12-20 08:57:27 -05:00
29a2db0e0c Fixed a bug that required the -f flag in conjunction with -e to use pty. 2024-12-15 21:27:39 -05:00
b6201235e6 Removed the emacs speech driver. Also some cleanup missed from removing the old espeak driver that no longer worked. 2024-12-11 17:31:05 -05:00
f7584463e3 Changed default speech driver to speech-dispatcher. Lowered default speech rate a bit. 2024-12-11 08:46:22 -05:00
136 changed files with 4354 additions and 4528 deletions

View File

@ -33,14 +33,11 @@ genericFrequencyCommand=play -q -v fenrirVolume -n -c1 synth fenrirDuration sine
enabled=True enabled=True
# Select speech driver, options are speechdDriver or genericDriver: # Select speech driver, options are speechdDriver or genericDriver:
#driver=speechdDriver driver=speechdDriver
driver=genericDriver #driver=genericDriver
# server path for emacspeak
# serverPath=
# The rate selects how fast Fenrir will speak. Options range from 0, slowest, to 1.0, fastest. # The rate selects how fast Fenrir will speak. Options range from 0, slowest, to 1.0, fastest.
rate=0.65 rate=0.5
# Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest. # Pitch controls the pitch of the voice, select from 0, lowest, to 1.0, highest.
pitch=0.5 pitch=0.5

View File

@ -1,21 +1,29 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
#https://python-packaging.readthedocs.io/en/latest/minimal.html
import os, glob, sys import os, glob, sys
import os.path import os.path
from shutil import copyfile from shutil import copyfile
from setuptools import find_packages from setuptools import find_namespace_packages
from setuptools import setup from setuptools import setup
fenrirVersion = '1.9.9'
packageVersion = 'post1'
# handle flags for package manager like aurman and pacaur. # handle flags for package manager like aurman and pacaur.
forceSettings = False # Allow both environment variable and command line flag
forceSettingsFlag = (
"--force-settings" in sys.argv or
os.environ.get('FENRIR_FORCE_SETTINGS') == '1'
)
if "--force-settings" in sys.argv: if "--force-settings" in sys.argv:
forceSettings = True
sys.argv.remove("--force-settings") sys.argv.remove("--force-settings")
data_files = [] dataFiles = []
# Handle locale files
localeFiles = glob.glob('locale/*/LC_MESSAGES/*.mo')
for localeFile in localeFiles:
lang = localeFile.split(os.sep)[1]
destDir = f'/usr/share/locale/{lang}/LC_MESSAGES'
dataFiles.append((destDir, [localeFile]))
# Handle other configuration files
directories = glob.glob('config/*') directories = glob.glob('config/*')
for directory in directories: for directory in directories:
files = glob.glob(directory+'/*') files = glob.glob(directory+'/*')
@ -26,25 +34,25 @@ for directory in directories:
destDir = '/etc/fenrirscreenreader/keyboard' destDir = '/etc/fenrirscreenreader/keyboard'
elif 'config/settings' in directory: elif 'config/settings' in directory:
destDir = '/etc/fenrirscreenreader/settings' destDir = '/etc/fenrirscreenreader/settings'
if not forceSettings: if not forceSettingsFlag:
try: try:
del(files[files.index('config/settings/settings.conf')]) files = [f for f in files if not f.endswith('settings.conf')]
except: except:
pass pass
elif 'config/scripts' in directory: elif 'config/scripts' in directory:
destDir = '/usr/share/fenrirscreenreader/scripts' destDir = '/usr/share/fenrirscreenreader/scripts'
if destDir != '': if destDir != '':
data_files.append((destDir, files)) dataFiles.append((destDir, files))
files = glob.glob('config/sound/default/*') files = glob.glob('config/sound/default/*')
destDir = '/usr/share/sounds/fenrirscreenreader/default' destDir = '/usr/share/sounds/fenrirscreenreader/default'
data_files.append((destDir, files)) dataFiles.append((destDir, files))
files = glob.glob('config/sound//template/*') files = glob.glob('config/sound//template/*')
destDir = '/usr/share/sounds/fenrirscreenreader/template' destDir = '/usr/share/sounds/fenrirscreenreader/template'
data_files.append((destDir, files)) dataFiles.append((destDir, files))
files = glob.glob('tools/*') files = glob.glob('tools/*')
data_files.append(('/usr/share/fenrirscreenreader/tools', files)) dataFiles.append(('/usr/share/fenrirscreenreader/tools', files))
data_files.append(('/usr/share/man/man1', ['docs/fenrir.1'])) dataFiles.append(('/usr/share/man/man1', ['docs/fenrir.1']))
def read(fname): def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read() return open(os.path.join(os.path.dirname(__file__), fname)).read()
@ -52,15 +60,13 @@ def read(fname):
setup( setup(
# Application name: # Application name:
name="fenrir-screenreader", name="fenrir-screenreader",
# Version number:
version=fenrirVersion + '.' + packageVersion,
# description # description
description="A TTY Screen Reader for Linux.", description="A TTY Screen Reader for Linux.",
long_description=read('README.md'), long_description=read('README.md'),
long_description_content_type="text/markdown",
keywords=['screenreader', 'a11y', 'accessibility', 'terminal', 'TTY', 'console'], keywords=['screenreader', 'a11y', 'accessibility', 'terminal', 'TTY', 'console'],
license="License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", license="License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
url="https://git.stormux.org/storm/fenrir/", url="https://git.stormux.org/storm/fenrir/",
download_url = 'https://git.stormux.org/storm/fenrir/archive/' + fenrirVersion + '.tar.gz',
classifiers=[ classifiers=[
"Programming Language :: Python", "Programming Language :: Python",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
@ -74,17 +80,21 @@ setup(
author_email="storm_dragon@stormux.org", author_email="storm_dragon@stormux.org",
# Packages # Packages
packages=find_packages('src/'), package_dir={'': 'src'},
package_dir={'': 'src/'}, packages=find_namespace_packages(
where='src',
include=['fenrirscreenreader*']
),
scripts=['src/fenrir'], scripts=['src/fenrir'],
# Include additional files into the package # Include additional files into the package
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
data_files=data_files, data_files=dataFiles,
# Dependent packages (distributions) # Dependent packages (distributions)
python_requires='>=3.6',
install_requires=[ install_requires=[
"evdev>=1.1.2", "evdev>=1.1.2",
"daemonize>=2.5.0", "daemonize>=2.5.0",
@ -95,10 +105,9 @@ setup(
"pyttsx3", "pyttsx3",
"pyte>=0.7.0", "pyte>=0.7.0",
], ],
) )
if not forceSettings: if not forceSettingsFlag:
print('') print('')
# create settings file from example if not exist # create settings file from example if not exist
if not os.path.isfile('/etc/fenrirscreenreader/settings/settings.conf'): if not os.path.isfile('/etc/fenrirscreenreader/settings/settings.conf'):

View File

@ -98,7 +98,7 @@ def main():
argumentParser.error(errorMsg) argumentParser.error(errorMsg)
sys.exit(1) sys.exit(1)
if cliArgs.foreground: if cliArgs.foreground or cliArgs.emulated_pty:
# Run directly in foreground # Run directly in foreground
run_fenrir() run_fenrir()
else: else:

View File

@ -1,21 +1,21 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No description found' return 'No description found'
def run(self): def run(self):
pass pass
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
# this command is just to initialize stuff. # this command is just to initialize stuff.
# like init index lists in memoryManager # like init index lists in memoryManager
# it is not useful to execute it # it is not useful to execute it
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
# clipboard # clipboard
self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards')) self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards'))
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No description found' return 'No description found'
def run(self): def run(self):
pass pass
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,30 +1,30 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import screen_utils from fenrirscreenreader.utils import screen_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Reads attributes of current cursor position') return _('Reads attributes of current cursor position')
def run(self): def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
try: try:
attributes = self.env['runtime']['attributeManager'].getAttributeByXY( cursorPos['x'], cursorPos['y']) attributes = self.env['runtime']['attributeManager'].getAttributeByXY( cursorPos['x'], cursorPos['y'])
except Exception as e: except Exception as e:
print(e) print(e)
attributeFormatString = self.env['runtime']['settingsManager'].getSetting('general', 'attributeFormatString') attributeFormatString = self.env['runtime']['settingsManager'].getSetting('general', 'attributeFormatString')
attributeFormatString = self.env['runtime']['attributeManager'].formatAttributes(attributes, attributeFormatString) attributeFormatString = self.env['runtime']['attributeManager'].formatAttributes(attributes, attributeFormatString)
self.env['runtime']['outputManager'].presentText(attributeFormatString, soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(attributeFormatString, soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,24 +1,24 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('clears the currently selected clipboard') return _('clears the currently selected clipboard')
def run(self): def run(self):
self.env['runtime']['memoryManager'].clearCurrentIndexList('clipboardHistory') self.env['runtime']['memoryManager'].clearCurrentIndexList('clipboardHistory')
self.env['runtime']['outputManager'].presentText(_('clipboard cleared'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard cleared'), interrupt=True)
return return
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,27 +1,27 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('speaks the contents of the currently selected clipboard') return _('speaks the contents of the currently selected clipboard')
def run(self): def run(self):
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'): if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
return return
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
self.env['runtime']['outputManager'].presentText(clipboard , interrupt=True) self.env['runtime']['outputManager'].presentText(clipboard , interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('reads the contents of the current screen') return _('reads the contents of the current screen')
def run(self): def run(self):
if self.env['screen']['newContentText'].isspace(): if self.env['screen']['newContentText'].isspace():
self.env['runtime']['outputManager'].presentText(_("screen is empty"), soundIcon='EmptyLine', interrupt=True) self.env['runtime']['outputManager'].presentText(_("screen is empty"), soundIcon='EmptyLine', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(self.env['screen']['newContentText'],interrupt=True) self.env['runtime']['outputManager'].presentText(self.env['screen']['newContentText'],interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,25 +1,25 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Column number for cursor') return _('Column number for cursor')
def run(self): def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
self.env['runtime']['outputManager'].presentText(str(cursorPos['x'] + 1) , interrupt=True) self.env['runtime']['outputManager'].presentText(str(cursorPos['x'] + 1) , interrupt=True)
self.env['runtime']['outputManager'].announceActiveCursor() self.env['runtime']['outputManager'].announceActiveCursor()
self.env['runtime']['outputManager'].presentText(' column number' , interrupt=False) self.env['runtime']['outputManager'].presentText(' column number' , interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,25 +1,25 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Line number for cursor') return _('Line number for cursor')
def run(self): def run(self):
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
self.env['runtime']['outputManager'].presentText(str(cursorPos['y'] + 1), interrupt=True) self.env['runtime']['outputManager'].presentText(str(cursorPos['y'] + 1), interrupt=True)
self.env['runtime']['outputManager'].announceActiveCursor() self.env['runtime']['outputManager'].announceActiveCursor()
self.env['runtime']['outputManager'].presentText(' line number' , interrupt=False) self.env['runtime']['outputManager'].presentText(' line number' , interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,30 +1,30 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import datetime import datetime
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('presents the date') return _('presents the date')
def run(self): def run(self):
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat') dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
# get the time formatted # get the time formatted
dateString = datetime.datetime.strftime(datetime.datetime.now(), dateFormat) dateString = datetime.datetime.strftime(datetime.datetime.now(), dateFormat)
# present the time via speak and braile, there is no soundicon, interrupt the current speech # present the time via speak and braile, there is no soundicon, interrupt the current speech
self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,33 +1,33 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import math import math
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('decrease sound volume') return _('decrease sound volume')
def run(self): def run(self):
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume') value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
value = round((math.ceil(10 * value) / 10) - 0.1, 2) value = round((math.ceil(10 * value) / 10) - 0.1, 2)
if value < 0.1: if value < 0.1:
value = 0.1 value = 0.1
self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value)) self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value))
self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOff', interrupt=True) self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOff', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,29 +1,29 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import math import math
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Decreases the pitch of the speech') return _('Decreases the pitch of the speech')
def run(self): def run(self):
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch') value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')
value = round((math.ceil(10 * value) / 10) - 0.1, 2) value = round((math.ceil(10 * value) / 10) - 0.1, 2)
if value < 0.0: if value < 0.0:
value = 0.0 value = 0.0
self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value)) self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value))
self.env['runtime']['outputManager'].presentText(_('{0} percent speech pitch').format(int(value * 100)), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_('{0} percent speech pitch').format(int(value * 100)), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,30 +1,30 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import math import math
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Decreases the rate of the speech') return _('Decreases the rate of the speech')
def run(self): def run(self):
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate') value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate')
value = round((math.ceil(10 * value) / 10) - 0.1, 2) value = round((math.ceil(10 * value) / 10) - 0.1, 2)
if value < 0.0: if value < 0.0:
value = 0.0 value = 0.0
self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value)) self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value))
self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,31 +1,31 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import math import math
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Decreases the volume of the speech') return _('Decreases the volume of the speech')
def run(self): def run(self):
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume') value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume')
value = round((math.ceil(10 * value) / 10) - 0.1, 2) value = round((math.ceil(10 * value) / 10) - 0.1, 2)
if value < 0.1: if value < 0.1:
value = 0.1 value = 0.1
self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value)) self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value))
self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,28 +1,28 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('exits review mode') return _('exits review mode')
def run(self): def run(self):
if not self.env['runtime']['cursorManager'].isReviewMode(): if not self.env['runtime']['cursorManager'].isReviewMode():
self.env['runtime']['outputManager'].presentText(_("Not in Review Mode"), interrupt=True) self.env['runtime']['outputManager'].presentText(_("Not in Review Mode"), interrupt=True)
return return
self.env['runtime']['cursorManager'].clearReviewCursor() self.env['runtime']['cursorManager'].clearReviewCursor()
self.env['runtime']['outputManager'].presentText(_("Exiting Review Mode"), interrupt=True) self.env['runtime']['outputManager'].presentText(_("Exiting Review Mode"), interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,39 +1,39 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import os import os
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment, scriptPath=''): def initialize(self, environment, scriptPath=''):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('export the current fenrir clipboard to a file') return _('export the current fenrir clipboard to a file')
def run(self): def run(self):
clipboardFilePath = self.env['runtime']['settingsManager'].getSetting('general', 'clipboardExportPath') clipboardFilePath = self.env['runtime']['settingsManager'].getSetting('general', 'clipboardExportPath')
clipboardFilePath = clipboardFilePath.replace('$user',self.env['general']['currUser']) clipboardFilePath = clipboardFilePath.replace('$user',self.env['general']['currUser'])
clipboardFilePath = clipboardFilePath.replace('$USER',self.env['general']['currUser']) clipboardFilePath = clipboardFilePath.replace('$USER',self.env['general']['currUser'])
clipboardFilePath = clipboardFilePath.replace('$User',self.env['general']['currUser']) clipboardFilePath = clipboardFilePath.replace('$User',self.env['general']['currUser'])
clipboardFile = open(clipboardFilePath,'w') clipboardFile = open(clipboardFilePath,'w')
try: try:
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'): if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
return return
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
clipboardFile.write(clipboard) clipboardFile.write(clipboard)
clipboardFile.close() clipboardFile.close()
os.chmod(clipboardFilePath, 0o666) os.chmod(clipboardFilePath, 0o666)
self.env['runtime']['outputManager'].presentText(_('clipboard exported to file'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard exported to file'), interrupt=True)
except Exception as e: except Exception as e:
self.env['runtime']['debug'].writeDebugOut('export_clipboard_to_file:run: Filepath:'+ clipboardFile +' trace:' + str(e),debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('export_clipboard_to_file:run: Filepath:'+ clipboardFile +' trace:' + str(e),debug.debugLevel.ERROR)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,77 +1,77 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import subprocess, os import subprocess, os
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
import _thread import _thread
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Export current fenrir clipboard to X or GUI clipboard') return _('Export current fenrir clipboard to X or GUI clipboard')
def run(self): def run(self):
_thread.start_new_thread(self._threadRun , ()) _thread.start_new_thread(self._threadRun , ())
def _threadRun(self): def _threadRun(self):
try: try:
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'): if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
return return
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
user = self.env['general']['currUser'] user = self.env['general']['currUser']
# First try to find xclip in common locations # First try to find xclip in common locations
xclip_paths = [ xclip_paths = [
'/usr/bin/xclip', '/usr/bin/xclip',
'/bin/xclip', '/bin/xclip',
'/usr/local/bin/xclip' '/usr/local/bin/xclip'
] ]
xclip_path = None xclip_path = None
for path in xclip_paths: for path in xclip_paths:
if os.path.isfile(path) and os.access(path, os.X_OK): if os.path.isfile(path) and os.access(path, os.X_OK):
xclip_path = path xclip_path = path
break break
if not xclip_path: if not xclip_path:
self.env['runtime']['outputManager'].presentText( self.env['runtime']['outputManager'].presentText(
'xclip not found in common locations', 'xclip not found in common locations',
interrupt=True interrupt=True
) )
return return
for display in range(10): for display in range(10):
p = Popen( p = Popen(
['su', user, '-p', '-c', f"{xclip_path} -d :{display} -selection clipboard"], ['su', user, '-p', '-c', f"{xclip_path} -d :{display} -selection clipboard"],
stdin=PIPE, stdout=PIPE, stderr=PIPE, preexec_fn=os.setpgrp stdin=PIPE, stdout=PIPE, stderr=PIPE, preexec_fn=os.setpgrp
) )
stdout, stderr = p.communicate(input=clipboard.encode('utf-8')) stdout, stderr = p.communicate(input=clipboard.encode('utf-8'))
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
stderr = stderr.decode('utf-8') stderr = stderr.decode('utf-8')
stdout = stdout.decode('utf-8') stdout = stdout.decode('utf-8')
if stderr == '': if stderr == '':
break break
if stderr != '': if stderr != '':
self.env['runtime']['outputManager'].presentText(stderr, soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(stderr, soundIcon='', interrupt=False)
else: else:
self.env['runtime']['outputManager'].presentText('exported to the X session.', interrupt=True) self.env['runtime']['outputManager'].presentText('exported to the X session.', interrupt=True)
except Exception as e: except Exception as e:
self.env['runtime']['outputManager'].presentText(str(e), soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(str(e), soundIcon='', interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,28 +1,28 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('selects the first clipboard') return _('selects the first clipboard')
def run(self): def run(self):
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'): if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
return return
self.env['runtime']['memoryManager'].setFirstIndex('clipboardHistory') self.env['runtime']['memoryManager'].setFirstIndex('clipboardHistory')
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True) self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,24 +1,24 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('sends the following keypress to the terminal or application') return _('sends the following keypress to the terminal or application')
def run(self): def run(self):
self.env['input']['keyForeward'] = 3 self.env['input']['keyForeward'] = 3
self.env['runtime']['outputManager'].presentText(_('Forward next keypress'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('Forward next keypress'), interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,54 +1,54 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import subprocess, os import subprocess, os
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
import _thread import _thread
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment, scriptPath=''): def initialize(self, environment, scriptPath=''):
self.env = environment self.env = environment
self.scriptPath = scriptPath self.scriptPath = scriptPath
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _("imports the graphical clipboard to Fenrir's clipboard") return _("imports the graphical clipboard to Fenrir's clipboard")
def run(self): def run(self):
_thread.start_new_thread(self._threadRun , ()) _thread.start_new_thread(self._threadRun , ())
def _threadRun(self): def _threadRun(self):
try: try:
# Find xclip path # Find xclip path
xclip_paths = ['/usr/bin/xclip', '/bin/xclip', '/usr/local/bin/xclip'] xclip_paths = ['/usr/bin/xclip', '/bin/xclip', '/usr/local/bin/xclip']
xclip_path = None xclip_path = None
for path in xclip_paths: for path in xclip_paths:
if os.path.isfile(path) and os.access(path, os.X_OK): if os.path.isfile(path) and os.access(path, os.X_OK):
xclip_path = path xclip_path = path
break break
if not xclip_path: if not xclip_path:
self.env['runtime']['outputManager'].presentText('xclip not found in common locations', interrupt=True) self.env['runtime']['outputManager'].presentText('xclip not found in common locations', interrupt=True)
return return
xClipboard = '' xClipboard = ''
for display in range(10): for display in range(10):
p = Popen('su ' + self.env['general']['currUser'] + ' -p -c "' + xclip_path + ' -d :' + str(display) + ' -o"', stdout=PIPE, stderr=PIPE, shell=True) p = Popen('su ' + self.env['general']['currUser'] + ' -p -c "' + xclip_path + ' -d :' + str(display) + ' -o"', stdout=PIPE, stderr=PIPE, shell=True)
stdout, stderr = p.communicate() stdout, stderr = p.communicate()
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
stderr = stderr.decode('utf-8') stderr = stderr.decode('utf-8')
xClipboard = stdout.decode('utf-8') xClipboard = stdout.decode('utf-8')
if (stderr == ''): if (stderr == ''):
break break
if stderr != '': if stderr != '':
self.env['runtime']['outputManager'].presentText(stderr , soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(stderr , soundIcon='', interrupt=False)
else: else:
self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', xClipboard) self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', xClipboard)
self.env['runtime']['outputManager'].presentText('Import to Clipboard', soundIcon='CopyToClipboard', interrupt=True) self.env['runtime']['outputManager'].presentText('Import to Clipboard', soundIcon='CopyToClipboard', interrupt=True)
self.env['runtime']['outputManager'].presentText(xClipboard, soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(xClipboard, soundIcon='', interrupt=False)
except Exception as e: except Exception as e:
self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,32 +1,32 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import math import math
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('adjusts the volume for in coming sounds') return _('adjusts the volume for in coming sounds')
def run(self): def run(self):
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume') value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
value = round((math.ceil(10 * value) / 10) + 0.1, 2) value = round((math.ceil(10 * value) / 10) + 0.1, 2)
if value > 1.0: if value > 1.0:
value = 1.0 value = 1.0
self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value)) self.env['runtime']['settingsManager'].setSetting('sound', 'volume', str(value))
self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOn', interrupt=True) self.env['runtime']['outputManager'].presentText(_("{0} percent sound volume").format(int(value * 100)), soundIcon='SoundOn', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,30 +1,30 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import math import math
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Increases the pitch of the speech') return _('Increases the pitch of the speech')
def run(self): def run(self):
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch') value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')
value = round((math.ceil(10 * value) / 10) + 0.1, 2) value = round((math.ceil(10 * value) / 10) + 0.1, 2)
if value > 1.0: if value > 1.0:
value = 1.0 value = 1.0
self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value)) self.env['runtime']['settingsManager'].setSetting('speech', 'pitch', str(value))
self.env['runtime']['outputManager'].presentText(_("{0} percent speech pitch").format(int(value * 100)), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("{0} percent speech pitch").format(int(value * 100)), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,30 +1,30 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import math import math
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Increase the speech rate') return _('Increase the speech rate')
def run(self): def run(self):
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate') value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate')
value = round((math.ceil(10 * value) / 10) + 0.1, 2) value = round((math.ceil(10 * value) / 10) + 0.1, 2)
if value > 1.0: if value > 1.0:
value = 1.0 value = 1.0
self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value)) self.env['runtime']['settingsManager'].setSetting('speech', 'rate', str(value))
self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("{0} percent speech rate").format(int(value * 100)), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,30 +1,30 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import math import math
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Increase the speech volume') return _('Increase the speech volume')
def run(self): def run(self):
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume') value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume')
value = round((math.ceil(10 * value) / 10) + 0.1, 2) value = round((math.ceil(10 * value) / 10) + 0.1, 2)
if value > 1.0: if value > 1.0:
value = 1.0 value = 1.0
self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value)) self.env['runtime']['settingsManager'].setSetting('speech', 'volume', str(value))
self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("{0} percent speech volume").format(int(value * 100)), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,28 +1,28 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('selects the last clipboard') return _('selects the last clipboard')
def run(self): def run(self):
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'): if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
return return
self.env['runtime']['memoryManager'].setLastIndex('clipboardHistory') self.env['runtime']['memoryManager'].setLastIndex('clipboardHistory')
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True) self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,23 +1,23 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Presents the text which was last received') return _('Presents the text which was last received')
def run(self): def run(self):
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=True) self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,36 +1,36 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('selects the next clipboard') return _('selects the next clipboard')
def run(self): def run(self):
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'): if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
return return
self.env['runtime']['memoryManager'].getNextIndex('clipboardHistory') self.env['runtime']['memoryManager'].getNextIndex('clipboardHistory')
isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory') isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory')
isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory') isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory')
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
if isFirst: if isFirst:
self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True) self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True)
if isLast: if isLast:
self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True) self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True)
speechInterrupt = not(isLast or isFirst) speechInterrupt = not(isLast or isFirst)
self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt) self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,30 +1,30 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import time import time
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards')) self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards'))
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('pastes the text from the currently selected clipboard') return _('pastes the text from the currently selected clipboard')
def run(self): def run(self):
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'): if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
return return
self.env['runtime']['outputManager'].presentText('paste clipboard', soundIcon='PasteClipboardOnScreen', interrupt=True) self.env['runtime']['outputManager'].presentText('paste clipboard', soundIcon='PasteClipboardOnScreen', interrupt=True)
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
self.env['runtime']['screenManager'].injectTextToScreen(clipboard) self.env['runtime']['screenManager'].injectTextToScreen(clipboard)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,35 +1,35 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('selects the previous clipboard') return _('selects the previous clipboard')
def run(self): def run(self):
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'): if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True) self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
return return
self.env['runtime']['memoryManager'].setPrefIndex('clipboardHistory') self.env['runtime']['memoryManager'].setPrefIndex('clipboardHistory')
isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory') isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory')
isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory') isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory')
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory') clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
if isFirst: if isFirst:
self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True) self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True)
if isLast: if isLast:
self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True) self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True)
speechInterrupt = not(isLast or isFirst) speechInterrupt = not(isLast or isFirst)
self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt) self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,24 +1,24 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('exits Fenrir') return _('exits Fenrir')
def run(self): def run(self):
self.env['runtime']['eventManager'].stopMainEventLoop() self.env['runtime']['eventManager'].stopMainEventLoop()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,32 +1,32 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import line_utils from fenrirscreenreader.utils import line_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('current line') return _('current line')
def run(self): def run(self):
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currLine = \ 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']) line_utils.getCurrentLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
if currLine.isspace(): if currLine.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(currLine, interrupt=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,37 +1,37 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('current word.') return _('current word.')
def run(self): def run(self):
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \ 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']) word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
if currWord.isspace(): if currWord.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
if endOfScreen: if endOfScreen:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
if lineBreak: if lineBreak:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,41 +1,41 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
from fenrirscreenreader.utils import char_utils from fenrirscreenreader.utils import char_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Phonetically spells the current word') return _('Phonetically spells the current word')
def run(self): def run(self):
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \ 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']) word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
if currWord.isspace(): if currWord.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
else: else:
firstSequence = True firstSequence = True
for c in currWord: for c in currWord:
currChar = char_utils.getPhonetic(c) currChar = char_utils.getPhonetic(c)
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
firstSequence = False firstSequence = False
if endOfScreen: if endOfScreen:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
if lineBreak: if lineBreak:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,36 +1,36 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import line_utils from fenrirscreenreader.utils import line_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('moves review to the next line ') return _('moves review to the next line ')
def run(self): def run(self):
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview'] self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
if not self.env['screen']['newCursorReview']: if not self.env['screen']['newCursorReview']:
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy() self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextLine, endOfScreen = \ 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']) line_utils.getNextLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
if nextLine.isspace(): if nextLine.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(nextLine, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(nextLine, interrupt=True, flush=False)
if endOfScreen: if endOfScreen:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,39 +1,39 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('moves review to the next word ') return _('moves review to the next word ')
def run(self): def run(self):
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview'] self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
if self.env['screen']['newCursorReview'] == None: if self.env['screen']['newCursorReview'] == None:
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy() self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \ 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']) word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
if nextWord.isspace(): if nextWord.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(nextWord, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(nextWord, interrupt=True, flush=False)
if endOfScreen: if endOfScreen:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
if lineBreak: if lineBreak:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,41 +1,41 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
from fenrirscreenreader.utils import char_utils from fenrirscreenreader.utils import char_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Phonetically spells the next word and moves review to it') return _('Phonetically spells the next word and moves review to it')
def run(self): def run(self):
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \ 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']) word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
if nextWord.isspace(): if nextWord.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
else: else:
firstSequence = True firstSequence = True
for c in nextWord: for c in nextWord:
currChar = char_utils.getPhonetic(c) currChar = char_utils.getPhonetic(c)
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
firstSequence = False firstSequence = False
if endOfScreen: if endOfScreen:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
if lineBreak: if lineBreak:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,35 +1,35 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import line_utils from fenrirscreenreader.utils import line_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('moves review to the previous line ') return _('moves review to the previous line ')
def run(self): def run(self):
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevLine, endOfScreen = \ 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']) line_utils.getPrevLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
if prevLine.isspace(): if prevLine.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(prevLine, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(prevLine, interrupt=True, flush=False)
if endOfScreen: if endOfScreen:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,37 +1,37 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('moves review focus to the previous word ') return _('moves review focus to the previous word ')
def run(self): def run(self):
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \ 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']) word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
if prevWord.isspace(): if prevWord.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
else: else:
self.env['runtime']['outputManager'].presentText(prevWord, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(prevWord, interrupt=True, flush=False)
if endOfScreen: if endOfScreen:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=False, soundIcon='EndOfScreen') self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=False, soundIcon='EndOfScreen')
if lineBreak: if lineBreak:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,41 +1,41 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
from fenrirscreenreader.utils import char_utils from fenrirscreenreader.utils import char_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Phonetically spells the previous word and moves review to it') return _('Phonetically spells the previous word and moves review to it')
def run(self): def run(self):
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor() self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \ 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']) word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
if prevWord.isspace(): if prevWord.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
else: else:
firstSequence = True firstSequence = True
for c in prevWord: for c in prevWord:
currChar = char_utils.getPhonetic(c) currChar = char_utils.getPhonetic(c)
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
firstSequence = False firstSequence = False
if endOfScreen: if endOfScreen:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen') self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
if lineBreak: if lineBreak:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'): if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine') self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,24 +1,24 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.core import settingsManager from fenrirscreenreader.core import settingsManager
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Saves your current Fenrir settings so they are the default.') return _('Saves your current Fenrir settings so they are the default.')
def run(self): def run(self):
settingsFile = self.env['runtime']['settingsManager'].getSettingsFile() settingsFile = self.env['runtime']['settingsManager'].getSettingsFile()
self.env['runtime']['settingsManager'].saveSettings(settingsFile) self.env['runtime']['settingsManager'].saveSettings(settingsFile)
self.env['runtime']['outputManager'].presentText(_("Settings saved."), interrupt=True) self.env['runtime']['outputManager'].presentText(_("Settings saved."), interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,23 +1,23 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Interrupts the current presentation') return _('Interrupts the current presentation')
def run(self): def run(self):
if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']): if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']):
return return
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,50 +1,50 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import subprocess, os import subprocess, os
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
import _thread import _thread
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment, scriptPath=''): def initialize(self, environment, scriptPath=''):
self.env = environment self.env = environment
self.scriptPath = scriptPath self.scriptPath = scriptPath
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('script: {0} fullpath: {1}').format(os.path.basename(self.scriptPath), self.scriptPath) return _('script: {0} fullpath: {1}').format(os.path.basename(self.scriptPath), self.scriptPath)
def run(self): def run(self):
if not os.path.exists(self.scriptPath): if not os.path.exists(self.scriptPath):
self.env['runtime']['outputManager'].presentText(_('Script file not found'), soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(_('Script file not found'), soundIcon='', interrupt=False)
return return
if not os.path.isfile(self.scriptPath): if not os.path.isfile(self.scriptPath):
self.env['runtime']['outputManager'].presentText(_('Script source is not a valid file'), soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(_('Script source is not a valid file'), soundIcon='', interrupt=False)
return return
if not os.access(self.scriptPath, os.X_OK): if not os.access(self.scriptPath, os.X_OK):
self.env['runtime']['outputManager'].presentText(_('Script file is not executable'), soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(_('Script file is not executable'), soundIcon='', interrupt=False)
return return
_thread.start_new_thread(self._threadRun , ()) _thread.start_new_thread(self._threadRun , ())
def _threadRun(self): def _threadRun(self):
try: try:
callstring = self.scriptPath + ' ' + self.env['general']['currUser'] callstring = self.scriptPath + ' ' + self.env['general']['currUser']
p = Popen(callstring , stdout=PIPE, stderr=PIPE, shell=True) p = Popen(callstring , stdout=PIPE, stderr=PIPE, shell=True)
stdout, stderr = p.communicate() stdout, stderr = p.communicate()
stdout = stdout.decode('utf-8') stdout = stdout.decode('utf-8')
stderr = stderr.decode('utf-8') stderr = stderr.decode('utf-8')
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
if stderr != '': if stderr != '':
self.env['runtime']['outputManager'].presentText(str(stderr) , soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(str(stderr) , soundIcon='', interrupt=False)
if stdout != '': if stdout != '':
self.env['runtime']['outputManager'].presentText(str(stdout) , soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(str(stdout) , soundIcon='', interrupt=False)
except Exception as e: except Exception as e:
self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,23 +1,23 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('disables speech until next keypress') return _('disables speech until next keypress')
def run(self): def run(self):
self.env['runtime']['outputManager'].tempDisableSpeech() self.env['runtime']['outputManager'].tempDisableSpeech()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,30 +1,30 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import datetime import datetime
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('presents the time') return _('presents the time')
def run(self): def run(self):
timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat') timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat')
# get the time formatted # get the time formatted
timeString = datetime.datetime.strftime(datetime.datetime.now(), timeFormat) timeString = datetime.datetime.strftime(datetime.datetime.now(), timeFormat)
# present the time via speak and braile, there is no soundicon, interrupt the current speech # present the time via speak and braile, there is no soundicon, interrupt the current speech
self.env['runtime']['outputManager'].presentText(timeString , soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(timeString , soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('enables or disables automatic reading of indentation level changes') return _('enables or disables automatic reading of indentation level changes')
def run(self): def run(self):
self.env['runtime']['settingsManager'].setSetting('general', 'autoPresentIndent', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'))) self.env['runtime']['settingsManager'].setSetting('general', 'autoPresentIndent', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent')))
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'): if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
self.env['runtime']['outputManager'].presentText(_("autoindent enabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("autoindent enabled"), soundIcon='', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_("autoindent disabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("autoindent disabled"), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('enables or disables automatic reading of new text as it appears') return _('enables or disables automatic reading of new text as it appears')
def run(self): def run(self):
self.env['runtime']['settingsManager'].setSetting('speech', 'autoReadIncoming', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'))) self.env['runtime']['settingsManager'].setSetting('speech', 'autoReadIncoming', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming')))
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'): if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'autoReadIncoming'):
self.env['runtime']['outputManager'].presentText(_("autoread enabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("autoread enabled"), soundIcon='', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_("autoread disabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("autoread disabled"), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,27 +1,27 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('enables or disables automatic spell checking') return _('enables or disables automatic spell checking')
def run(self): def run(self):
self.env['runtime']['settingsManager'].setSetting('general', 'autoSpellCheck', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck'))) self.env['runtime']['settingsManager'].setSetting('general', 'autoSpellCheck', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck')))
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck'): if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoSpellCheck'):
self.env['runtime']['outputManager'].presentText(_("auto spellcheck enabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("auto spellcheck enabled"), soundIcon='', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_("auto spellcheck disabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("auto spellcheck disabled"), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Enables or disables automatic reading of time after specified intervals') return _('Enables or disables automatic reading of time after specified intervals')
def run(self): def run(self):
self.env['runtime']['settingsManager'].setSetting('time', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'))) self.env['runtime']['settingsManager'].setSetting('time', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled')))
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'): if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'):
self.env['runtime']['outputManager'].presentText(_("Automatic time announcement enabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("Automatic time announcement enabled"), soundIcon='', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_("Automatic time announcement disabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("Automatic time announcement disabled"), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('enables or disables the barrier mode') return _('enables or disables the barrier mode')
def run(self): def run(self):
self.env['runtime']['settingsManager'].setSetting('barrier', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('barrier', 'enabled'))) self.env['runtime']['settingsManager'].setSetting('barrier', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('barrier', 'enabled')))
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier', 'enabled'): if self.env['runtime']['settingsManager'].getSettingAsBool('barrier', 'enabled'):
self.env['runtime']['outputManager'].presentText(_("barrier mode enabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("barrier mode enabled"), soundIcon='', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_("barrier mode disabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("barrier mode disabled"), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('enables or disables announcement of emoticons instead of chars') return _('enables or disables announcement of emoticons instead of chars')
def run(self): def run(self):
self.env['runtime']['settingsManager'].setSetting('general', 'emoticons', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons'))) self.env['runtime']['settingsManager'].setSetting('general', 'emoticons', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons')))
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons'): if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons'):
self.env['runtime']['outputManager'].presentText(_('emoticons enabled'), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_('emoticons enabled'), soundIcon='', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_('emoticons disabled'), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_('emoticons disabled'), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('enables or disables the announcement of attributes') return _('enables or disables the announcement of attributes')
def run(self): def run(self):
self.env['runtime']['settingsManager'].setSetting('general', 'hasAttributes', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'))) self.env['runtime']['settingsManager'].setSetting('general', 'hasAttributes', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes')))
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'): if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
self.env['runtime']['outputManager'].presentText(_("announcement of attributes enabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("announcement of attributes enabled"), soundIcon='', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_("announcement of attributes disabled"), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_("announcement of attributes disabled"), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,29 +1,29 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('enables or disables tracking of highlighted text') return _('enables or disables tracking of highlighted text')
def run(self): def run(self):
currMode = self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight') currMode = self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight')
self.env['runtime']['settingsManager'].setSetting('focus', 'highlight', str(not currMode)) self.env['runtime']['settingsManager'].setSetting('focus', 'highlight', str(not currMode))
self.env['runtime']['settingsManager'].setSetting('focus', 'cursor', str(currMode)) self.env['runtime']['settingsManager'].setSetting('focus', 'cursor', str(currMode))
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'): if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'highlight'):
self.env['runtime']['outputManager'].presentText(_('highlight tracking'), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_('highlight tracking'), soundIcon='', interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_('cursor tracking'), soundIcon='', interrupt=True) self.env['runtime']['outputManager'].presentText(_('cursor tracking'), soundIcon='', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,27 +1,27 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('enables or disables sound') return _('enables or disables sound')
def run(self): def run(self):
if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'): if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'):
self.env['runtime']['outputManager'].presentText(_('sound disabled'), soundIcon='SoundOff', interrupt=True) self.env['runtime']['outputManager'].presentText(_('sound disabled'), soundIcon='SoundOff', interrupt=True)
self.env['runtime']['settingsManager'].setSetting('sound', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'))) self.env['runtime']['settingsManager'].setSetting('sound', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled')))
if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'): if self.env['runtime']['settingsManager'].getSettingAsBool('sound', 'enabled'):
self.env['runtime']['outputManager'].presentText(_('sound enabled'), soundIcon='SoundOn', interrupt=True) self.env['runtime']['outputManager'].presentText(_('sound enabled'), soundIcon='SoundOn', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,28 +1,28 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('enables or disables speech') return _('enables or disables speech')
def run(self): def run(self):
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'): if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
self.env['runtime']['outputManager'].presentText(_('speech disabled'), soundIcon='SpeechOff', interrupt=True) self.env['runtime']['outputManager'].presentText(_('speech disabled'), soundIcon='SpeechOff', interrupt=True)
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'))) self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(not self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled')))
if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'): if self.env['runtime']['settingsManager'].getSettingAsBool('speech', 'enabled'):
self.env['runtime']['outputManager'].presentText(_('speech enabled'), soundIcon='SpeechOn', interrupt=True) self.env['runtime']['outputManager'].presentText(_('speech enabled'), soundIcon='SpeechOn', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,25 +0,0 @@
#!/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 -*-
# 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']].
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
[['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']]
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']]

View File

@ -1,33 +1,33 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
return return
if self.env['runtime']['screenManager'].isScreenChange(): if self.env['runtime']['screenManager'].isScreenChange():
return return
# if the filter is set # if the filter is set
#if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '': #if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '':
# filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',') # filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',')
# for currInput in self.env['input']['currInput']: # for currInput in self.env['input']['currInput']:
# if not currInput in filterList: # if not currInput in filterList:
# return # return
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,27 +1,27 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('disables speech until next keypress') return _('disables speech until next keypress')
def run(self): def run(self):
if not self.env['commandBuffer']['enableSpeechOnKeypress']: if not self.env['commandBuffer']['enableSpeechOnKeypress']:
return return
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress'])) self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress']))
self.env['commandBuffer']['enableSpeechOnKeypress'] = False self.env['commandBuffer']['enableSpeechOnKeypress'] = False
self.env['runtime']['outputManager'].presentText(_("speech enabled"), soundIcon='SpeechOn', interrupt=True) self.env['runtime']['outputManager'].presentText(_("speech enabled"), soundIcon='SpeechOn', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,55 +1,55 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# enabled? # enabled?
active = self.env['runtime']['settingsManager'].getSettingAsInt('keyboard', 'charEchoMode') active = self.env['runtime']['settingsManager'].getSettingAsInt('keyboard', 'charEchoMode')
# 0 = off # 0 = off
if active == 0: if active == 0:
return return
# 2 = caps only # 2 = caps only
if active == 2: if active == 2:
if not self.env['input']['newCapsLock']: if not self.env['input']['newCapsLock']:
return 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) # 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)
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']) xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
if xMove > 3: if xMove > 3:
return return
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']: if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
if self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_TAB']]: if self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_TAB']]:
return return
elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']: elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
if self.env['runtime']['byteManager'].getLastByteKey() in [b' ', b'\t']: if self.env['runtime']['byteManager'].getLastByteKey() in [b' ', b'\t']:
return return
# detect deletion or chilling # detect deletion or chilling
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']: if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
return return
# is there any change? # is there any change?
if not self.env['runtime']['screenManager'].isDelta(): if not self.env['runtime']['screenManager'].isDelta():
return return
# filter unneded space on word begin # filter unneded space on word begin
currDelta = self.env['screen']['newDelta'] currDelta = self.env['screen']['newDelta']
if len(currDelta.strip()) != len(currDelta) and \ if len(currDelta.strip()) != len(currDelta) and \
currDelta.strip() != '': currDelta.strip() != '':
currDelta = currDelta.strip() currDelta = currDelta.strip()
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
print(currDelta) print(currDelta)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,58 +1,58 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
import string import string
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# is it enabled? # is it enabled?
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
return return
# is naviation? # is naviation?
if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1: if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1:
return return
# just when cursor move worddetection is needed # just when cursor move worddetection is needed
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
# for now no new line # for now no new line
if self.env['runtime']['cursorManager'].isCursorVerticalMove(): if self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
# currently writing # currently writing
if self.env['runtime']['screenManager'].isDelta(): if self.env['runtime']['screenManager'].isDelta():
return return
# get the word # get the word
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \ x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
# is there a word? # is there a word?
if currWord == '': if currWord == '':
return return
# at the end of a word # at the end of a word
if not newContent[self.env['screen']['newCursor']['x']].isspace(): if not newContent[self.env['screen']['newCursor']['x']].isspace():
return return
# at the end of a word # at the end of a word
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \ if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
(x + len(currWord) != self.env['screen']['newCursor']['x']-1): (x + len(currWord) != self.env['screen']['newCursor']['x']-1):
return return
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,46 +1,46 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
return return
# detect typing or chilling # detect typing or chilling
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']: if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
return return
# More than just a deletion happend # More than just a deletion happend
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True): if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
return return
# no deletion # no deletion
if not self.env['runtime']['screenManager'].isNegativeDelta(): if not self.env['runtime']['screenManager'].isNegativeDelta():
return return
# too much for a single backspace... # too much for a single backspace...
# word begin produce a diff wiht len == 2 |a | others with 1 |a| # word begin produce a diff wiht len == 2 |a | others with 1 |a|
if len(self.env['screen']['newNegativeDelta']) > 2: if len(self.env['screen']['newNegativeDelta']) > 2:
return return
currNegativeDelta = self.env['screen']['newNegativeDelta'] currNegativeDelta = self.env['screen']['newNegativeDelta']
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \ if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
currNegativeDelta.strip() != '': currNegativeDelta.strip() != '':
currNegativeDelta = currNegativeDelta.strip() currNegativeDelta = currNegativeDelta.strip()
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,51 +1,51 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import char_utils from fenrirscreenreader.utils import char_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'): if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
return return
if self.env['runtime']['screenManager'].isScreenChange(): if self.env['runtime']['screenManager'].isScreenChange():
return return
# detect an change on the screen, we just want to cursor arround, so no change should appear # detect an change on the screen, we just want to cursor arround, so no change should appear
if self.env['runtime']['screenManager'].isDelta(): if self.env['runtime']['screenManager'].isDelta():
return return
if self.env['runtime']['screenManager'].isNegativeDelta(): if self.env['runtime']['screenManager'].isNegativeDelta():
return return
# is a vertical change? # is a vertical change?
if self.env['runtime']['cursorManager'].isCursorVerticalMove(): if self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
# is it a horizontal change? # is it a horizontal change?
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
# echo word insteed of char # echo word insteed of char
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'): if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1: if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
# get the word # get the word
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \ x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
if self.env['screen']['newCursor']['x'] == x: if self.env['screen']['newCursor']['x'] == x:
return return
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['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(): if not currChar.isspace():
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,49 +1,49 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# try to detect the tab completion by cursor change # try to detect the tab completion by cursor change
xMove = self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] xMove = self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']
if xMove <= 0: if xMove <= 0:
return return
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']: if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
if not (self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_TAB']]): if not (self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_TAB']]):
if xMove < 5: if xMove < 5:
return return
elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']: elif self.env['runtime']['inputManager'].getShortcutType() in ['BYTE']:
found = False found = False
for currByte in self.env['runtime']['byteManager'].getLastByteKey(): for currByte in self.env['runtime']['byteManager'].getLastByteKey():
if currByte == 9: if currByte == 9:
found = True found = True
if not found: if not found:
if xMove < 5: if xMove < 5:
return return
# is there any change? # is there any change?
if not self.env['runtime']['screenManager'].isDelta(): if not self.env['runtime']['screenManager'].isDelta():
return return
if not xMove == len(self.env['screen']['newDelta']): if not xMove == len(self.env['screen']['newDelta']):
return return
# filter unneded space on word begin # filter unneded space on word begin
currDelta = self.env['screen']['newDelta'] currDelta = self.env['screen']['newDelta']
if len(currDelta.strip()) != len(currDelta) and \ if len(currDelta.strip()) != len(currDelta) and \
currDelta.strip() != '': currDelta.strip() != '':
currDelta = currDelta.strip() currDelta = currDelta.strip()
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,54 +1,54 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
import string import string
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# is navigation? # is navigation?
if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1: if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
return return
# just when cursor move worddetection is needed # just when cursor move worddetection is needed
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
# for now no new line # for now no new line
if self.env['runtime']['cursorManager'].isCursorVerticalMove(): if self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
# currently writing # currently writing
if self.env['runtime']['screenManager'].isDelta(): if self.env['runtime']['screenManager'].isDelta():
return return
# get the word # get the word
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \ x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
# is there a word? # is there a word?
if currWord == '': if currWord == '':
return return
# at the start of a word # at the start of a word
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \ if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
(self.env['screen']['newCursor']['x'] != x): (self.env['screen']['newCursor']['x'] != x):
return return
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,62 +1,62 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import line_utils from fenrirscreenreader.utils import line_utils
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
class command(): class command():
def __init__(self): def __init__(self):
self.lastIdent = -1 self.lastIdent = -1
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'): if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
return return
if self.env['runtime']['screenManager'].isScreenChange(): if self.env['runtime']['screenManager'].isScreenChange():
self.lastIdent = 0 self.lastIdent = 0
return return
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack # 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 self.env['runtime']['screenManager'].isDelta():
return return
# is a vertical change? # is a vertical change?
if not self.env['runtime']['cursorManager'].isCursorVerticalMove(): if not self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText']) x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
if currLine.isspace(): if currLine.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
# ident # ident
currIdent = len(currLine) - len(currLine.lstrip()) currIdent = len(currLine) - len(currLine.lstrip())
if self.lastIdent == -1: if self.lastIdent == -1:
self.lastIdent = currIdent self.lastIdent = currIdent
doInterrupt = True doInterrupt = True
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'): if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,1]: if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,1]:
self.env['runtime']['outputManager'].playFrequence(currIdent * 50, 0.1, interrupt=doInterrupt) self.env['runtime']['outputManager'].playFrequence(currIdent * 50, 0.1, interrupt=doInterrupt)
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]: if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]:
if self.lastIdent != currIdent: if self.lastIdent != currIdent:
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False) self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
doInterrupt = False doInterrupt = False
# barrier # barrier
sayLine = currLine sayLine = currLine
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'): if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y']) isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
if isBarrier: if isBarrier:
sayLine = barrierLine sayLine = barrierLine
# output # output
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False) self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
self.lastIdent = currIdent self.lastIdent = currIdent
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,57 +1,57 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import line_utils from fenrirscreenreader.utils import line_utils
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
class command(): class command():
def __init__(self): def __init__(self):
self.lastIdent = -1 self.lastIdent = -1
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'): if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
return return
if self.env['runtime']['screenManager'].isScreenChange(): if self.env['runtime']['screenManager'].isScreenChange():
self.lastIdent = 0 self.lastIdent = 0
return return
# is a vertical change? # is a vertical change?
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText']) x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
currIdent = self.env['screen']['newCursor']['x'] currIdent = self.env['screen']['newCursor']['x']
if not currLine.isspace(): if not currLine.isspace():
# ident # ident
lastIdent, lastY, lastLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['oldContentText']) lastIdent, lastY, lastLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['oldContentText'])
if currLine.strip() != lastLine.strip(): if currLine.strip() != lastLine.strip():
return return
if len(currLine.lstrip()) == len(lastLine.lstrip()): if len(currLine.lstrip()) == len(lastLine.lstrip()):
return return
currIdent = len(currLine) - len(currLine.lstrip()) currIdent = len(currLine) - len(currLine.lstrip())
if self.lastIdent == -1: if self.lastIdent == -1:
self.lastIdent = currIdent self.lastIdent = currIdent
if currIdent <= 0: if currIdent <= 0:
return return
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'): if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,1]: if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,1]:
self.env['runtime']['outputManager'].playFrequence(currIdent * 50, 0.1, interrupt=False) self.env['runtime']['outputManager'].playFrequence(currIdent * 50, 0.1, interrupt=False)
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]: if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]:
if self.lastIdent != currIdent: if self.lastIdent != currIdent:
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=False, flush=False) self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=False, flush=False)
self.lastIdent = currIdent self.lastIdent = currIdent
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,34 +1,34 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import screen_utils from fenrirscreenreader.utils import screen_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Reads attributes of current cursor position') return _('Reads attributes of current cursor position')
def run(self): def run(self):
# is it enabled? # is it enabled?
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'): if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
return return
# is a vertical change? # is a vertical change?
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\ if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
self.env['runtime']['cursorManager'].isCursorHorizontalMove()): self.env['runtime']['cursorManager'].isCursorHorizontalMove()):
return return
cursorPos = self.env['screen']['newCursor'] cursorPos = self.env['screen']['newCursor']
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos): if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
return return
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False) self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('exits review mode') return _('exits review mode')
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'): if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
return return
if self.env['runtime']['cursorManager'].isReviewMode(): if self.env['runtime']['cursorManager'].isReviewMode():
self.env['runtime']['cursorManager'].clearReviewCursor() self.env['runtime']['cursorManager'].clearReviewCursor()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,42 +1,42 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# 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) # 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)
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']) xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
if xMove > 1: if xMove > 1:
return return
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'):
return return
# detect deletion or chilling # detect deletion or chilling
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']: if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
return return
# is there any change? # is there any change?
if not self.env['runtime']['screenManager'].isDelta(): if not self.env['runtime']['screenManager'].isDelta():
return return
# filter unneded space on word begin # filter unneded space on word begin
currDelta = self.env['screen']['newDelta'] currDelta = self.env['screen']['newDelta']
if len(currDelta.strip()) != len(currDelta) and \ if len(currDelta.strip()) != len(currDelta) and \
currDelta.strip() != '': currDelta.strip() != '':
currDelta = currDelta.strip() currDelta = currDelta.strip()
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,42 +1,42 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# try to detect the tab completion by cursor change # try to detect the tab completion by cursor change
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']) xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
if xMove == 1: if xMove == 1:
return return
# is there any change? # is there any change?
if not self.env['runtime']['screenManager'].isDelta(): if not self.env['runtime']['screenManager'].isDelta():
return return
if not( (xMove > 1) and xMove == len(self.env['screen']['newDelta'])): if not( (xMove > 1) and xMove == len(self.env['screen']['newDelta'])):
return return
# detect deletion or chilling # detect deletion or chilling
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']: if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
return return
# filter unneded space on word begin # filter unneded space on word begin
currDelta = self.env['screen']['newDelta'] currDelta = self.env['screen']['newDelta']
if len(currDelta.strip()) != len(currDelta) and \ if len(currDelta.strip()) != len(currDelta) and \
currDelta.strip() != '': currDelta.strip() != '':
currDelta = currDelta.strip() currDelta = currDelta.strip()
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,51 +1,51 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import char_utils from fenrirscreenreader.utils import char_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'): if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
return return
if self.env['runtime']['screenManager'].isScreenChange(): if self.env['runtime']['screenManager'].isScreenChange():
return return
# detect an change on the screen, we just want to cursor arround, so no change should appear # detect an change on the screen, we just want to cursor arround, so no change should appear
if self.env['runtime']['screenManager'].isDelta(): if self.env['runtime']['screenManager'].isDelta():
return return
if self.env['runtime']['screenManager'].isNegativeDelta(): if self.env['runtime']['screenManager'].isNegativeDelta():
return return
# is a vertical change? # is a vertical change?
if self.env['runtime']['cursorManager'].isCursorVerticalMove(): if self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
# is it a horizontal change? # is it a horizontal change?
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
# echo word insteed of char # echo word insteed of char
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'): if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1: if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
# get the word # get the word
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \ x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
if self.env['screen']['newCursor']['x'] == x: if self.env['screen']['newCursor']['x'] == x:
return return
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['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(): if not currChar.isspace():
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,59 +1,59 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import line_utils from fenrirscreenreader.utils import line_utils
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
class command(): class command():
def __init__(self): def __init__(self):
self.lastIdent = -1 self.lastIdent = -1
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'): if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
return return
if self.env['runtime']['screenManager'].isScreenChange(): if self.env['runtime']['screenManager'].isScreenChange():
self.lastIdent = 0 self.lastIdent = 0
return return
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack # 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 self.env['runtime']['screenManager'].isDelta():
return return
# is a vertical change? # is a vertical change?
if not self.env['runtime']['cursorManager'].isCursorVerticalMove(): if not self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText']) x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
if currLine.isspace(): if currLine.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
# ident # ident
currIdent = len(currLine) - len(currLine.lstrip()) currIdent = len(currLine) - len(currLine.lstrip())
if self.lastIdent == -1: if self.lastIdent == -1:
self.lastIdent = currIdent self.lastIdent = currIdent
doInterrupt = True doInterrupt = True
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'): if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
if self.lastIdent != currIdent: if self.lastIdent != currIdent:
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False) self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
doInterrupt = False doInterrupt = False
# barrier # barrier
sayLine = currLine sayLine = currLine
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'): if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y']) isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
if isBarrier: if isBarrier:
sayLine = barrierLine sayLine = barrierLine
# output # output
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False) self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
self.lastIdent = currIdent self.lastIdent = currIdent
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,58 +1,58 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
import string import string
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# is it enabled? # is it enabled?
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
return return
# is naviation? # is naviation?
if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1: if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1:
return return
# just when cursor move worddetection is needed # just when cursor move worddetection is needed
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
# for now no new line # for now no new line
if self.env['runtime']['cursorManager'].isCursorVerticalMove(): if self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
# currently writing # currently writing
if self.env['runtime']['screenManager'].isDelta(): if self.env['runtime']['screenManager'].isDelta():
return return
# get the word # get the word
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \ x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
# is there a word? # is there a word?
if currWord == '': if currWord == '':
return return
# at the end of a word # at the end of a word
if not newContent[self.env['screen']['newCursor']['x']].isspace(): if not newContent[self.env['screen']['newCursor']['x']].isspace():
return return
# at the end of a word # at the end of a word
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \ if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
(x + len(currWord) != self.env['screen']['newCursor']['x']-1): (x + len(currWord) != self.env['screen']['newCursor']['x']-1):
return return
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,54 +1,54 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
import string import string
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# is navigation? # is navigation?
if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1: if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
return return
# just when cursor move worddetection is needed # just when cursor move worddetection is needed
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
# for now no new line # for now no new line
if self.env['runtime']['cursorManager'].isCursorVerticalMove(): if self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
# currently writing # currently writing
if self.env['runtime']['screenManager'].isDelta(): if self.env['runtime']['screenManager'].isDelta():
return return
# get the word # get the word
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \ x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
# is there a word? # is there a word?
if currWord == '': if currWord == '':
return return
# at the start of a word # at the start of a word
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \ if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
(self.env['screen']['newCursor']['x'] != x): (self.env['screen']['newCursor']['x'] != x):
return return
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,46 +1,46 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
return return
# detect typing or chilling # detect typing or chilling
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']: if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
return return
# More than just a deletion happend # More than just a deletion happend
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True): if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
return return
# no deletion # no deletion
if not self.env['runtime']['screenManager'].isNegativeDelta(): if not self.env['runtime']['screenManager'].isNegativeDelta():
return return
# too much for a single backspace... # too much for a single backspace...
# word begin produce a diff wiht len == 2 |a | others with 1 |a| # word begin produce a diff wiht len == 2 |a | others with 1 |a|
if len(self.env['screen']['newNegativeDelta']) > 2: if len(self.env['screen']['newNegativeDelta']) > 2:
return return
currNegativeDelta = self.env['screen']['newNegativeDelta'] currNegativeDelta = self.env['screen']['newNegativeDelta']
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \ if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
currNegativeDelta.strip() != '': currNegativeDelta.strip() != '':
currNegativeDelta = currNegativeDelta.strip() currNegativeDelta = currNegativeDelta.strip()
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('exits review mode') return _('exits review mode')
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'): if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
return return
if self.env['runtime']['cursorManager'].isReviewMode(): if self.env['runtime']['cursorManager'].isReviewMode():
self.env['runtime']['cursorManager'].clearReviewCursor() self.env['runtime']['cursorManager'].clearReviewCursor()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,34 +1,34 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import screen_utils from fenrirscreenreader.utils import screen_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Reads attributes of current cursor position') return _('Reads attributes of current cursor position')
def run(self): def run(self):
# is it enabled? # is it enabled?
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'): if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
return return
# is a vertical change? # is a vertical change?
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\ if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
self.env['runtime']['cursorManager'].isCursorHorizontalMove()): self.env['runtime']['cursorManager'].isCursorHorizontalMove()):
return return
cursorPos = self.env['screen']['newCursor'] cursorPos = self.env['screen']['newCursor']
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos): if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
return return
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False) self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,42 +1,42 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# 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) # 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)
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']) xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
if xMove > 1: if xMove > 1:
return return
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charEcho'):
return return
# detect deletion or chilling # detect deletion or chilling
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']: if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
return return
# is there any change? # is there any change?
if not self.env['runtime']['screenManager'].isDelta(): if not self.env['runtime']['screenManager'].isDelta():
return return
# filter unneded space on word begin # filter unneded space on word begin
currDelta = self.env['screen']['newDelta'] currDelta = self.env['screen']['newDelta']
if len(currDelta.strip()) != len(currDelta) and \ if len(currDelta.strip()) != len(currDelta) and \
currDelta.strip() != '': currDelta.strip() != '':
currDelta = currDelta.strip() currDelta = currDelta.strip()
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,58 +1,58 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
import string import string
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# is it enabled? # is it enabled?
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
return return
# is naviation? # is naviation?
if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1: if self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'] != 1:
return return
# just when cursor move worddetection is needed # just when cursor move worddetection is needed
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
# for now no new line # for now no new line
if self.env['runtime']['cursorManager'].isCursorVerticalMove(): if self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
# currently writing # currently writing
if self.env['runtime']['screenManager'].isDelta(): if self.env['runtime']['screenManager'].isDelta():
return return
# get the word # get the word
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \ x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
# is there a word? # is there a word?
if currWord == '': if currWord == '':
return return
# at the end of a word # at the end of a word
if not newContent[self.env['screen']['newCursor']['x']].isspace(): if not newContent[self.env['screen']['newCursor']['x']].isspace():
return return
# at the end of a word # at the end of a word
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \ if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
(x + len(currWord) != self.env['screen']['newCursor']['x']-1): (x + len(currWord) != self.env['screen']['newCursor']['x']-1):
return return
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,46 +1,46 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'charDeleteEcho'):
return return
# detect typing or chilling # detect typing or chilling
if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']: if self.env['screen']['newCursor']['x'] >= self.env['screen']['oldCursor']['x']:
return return
# More than just a deletion happend # More than just a deletion happend
if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True): if self.env['runtime']['screenManager'].isDelta(ignoreSpace=True):
return return
# no deletion # no deletion
if not self.env['runtime']['screenManager'].isNegativeDelta(): if not self.env['runtime']['screenManager'].isNegativeDelta():
return return
# too much for a single backspace... # too much for a single backspace...
# word begin produce a diff wiht len == 2 |a | others with 1 |a| # word begin produce a diff wiht len == 2 |a | others with 1 |a|
if len(self.env['screen']['newNegativeDelta']) > 2: if len(self.env['screen']['newNegativeDelta']) > 2:
return return
currNegativeDelta = self.env['screen']['newNegativeDelta'] currNegativeDelta = self.env['screen']['newNegativeDelta']
if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \ if len(currNegativeDelta.strip()) != len(currNegativeDelta) and \
currNegativeDelta.strip() != '': currNegativeDelta.strip() != '':
currNegativeDelta = currNegativeDelta.strip() currNegativeDelta = currNegativeDelta.strip()
self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currNegativeDelta, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,51 +1,51 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import char_utils from fenrirscreenreader.utils import char_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'): if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
return return
if self.env['runtime']['screenManager'].isScreenChange(): if self.env['runtime']['screenManager'].isScreenChange():
return return
# detect an change on the screen, we just want to cursor arround, so no change should appear # detect an change on the screen, we just want to cursor arround, so no change should appear
if self.env['runtime']['screenManager'].isDelta(): if self.env['runtime']['screenManager'].isDelta():
return return
if self.env['runtime']['screenManager'].isNegativeDelta(): if self.env['runtime']['screenManager'].isNegativeDelta():
return return
# is a vertical change? # is a vertical change?
if self.env['runtime']['cursorManager'].isCursorVerticalMove(): if self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
# is it a horizontal change? # is it a horizontal change?
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
# echo word insteed of char # echo word insteed of char
if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'): if self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'wordEcho'):
if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1: if abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) != 1:
# get the word # get the word
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \ x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
if self.env['screen']['newCursor']['x'] == x: if self.env['screen']['newCursor']['x'] == x:
return return
x, y, currChar = char_utils.getCurrentChar(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['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(): if not currChar.isspace():
self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,42 +1,42 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# try to detect the tab completion by cursor change # try to detect the tab completion by cursor change
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x']) xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
if xMove == 1: if xMove == 1:
return return
# is there any change? # is there any change?
if not self.env['runtime']['screenManager'].isDelta(): if not self.env['runtime']['screenManager'].isDelta():
return return
if not( (xMove > 1) and xMove == len(self.env['screen']['newDelta'])): if not( (xMove > 1) and xMove == len(self.env['screen']['newDelta'])):
return return
# detect deletion or chilling # detect deletion or chilling
if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']: if self.env['screen']['newCursor']['x'] <= self.env['screen']['oldCursor']['x']:
return return
# filter unneded space on word begin # filter unneded space on word begin
currDelta = self.env['screen']['newDelta'] currDelta = self.env['screen']['newDelta']
if len(currDelta.strip()) != len(currDelta) and \ if len(currDelta.strip()) != len(currDelta) and \
currDelta.strip() != '': currDelta.strip() != '':
currDelta = currDelta.strip() currDelta = currDelta.strip()
self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False) self.env['runtime']['outputManager'].presentText(currDelta, interrupt=True, announceCapital=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,54 +1,54 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
import string import string
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
# is navigation? # is navigation?
if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1: if not abs(self.env['screen']['oldCursor']['x'] - self.env['screen']['newCursor']['x']) > 1:
return return
# just when cursor move worddetection is needed # just when cursor move worddetection is needed
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
# for now no new line # for now no new line
if self.env['runtime']['cursorManager'].isCursorVerticalMove(): if self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
# currently writing # currently writing
if self.env['runtime']['screenManager'].isDelta(): if self.env['runtime']['screenManager'].isDelta():
return return
# get the word # get the word
newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] newContent = self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]
x, y, currWord, endOfScreen, lineBreak = \ x, y, currWord, endOfScreen, lineBreak = \
word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent) word_utils.getCurrentWord(self.env['screen']['newCursor']['x'], 0, newContent)
# is there a word? # is there a word?
if currWord == '': if currWord == '':
return return
# at the start of a word # at the start of a word
if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \ if (x + len(currWord) != self.env['screen']['newCursor']['x']) and \
(self.env['screen']['newCursor']['x'] != x): (self.env['screen']['newCursor']['x'] != x):
return return
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,59 +1,59 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import line_utils from fenrirscreenreader.utils import line_utils
from fenrirscreenreader.utils import word_utils from fenrirscreenreader.utils import word_utils
class command(): class command():
def __init__(self): def __init__(self):
self.lastIdent = -1 self.lastIdent = -1
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'): if not self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'cursor'):
return return
if self.env['runtime']['screenManager'].isScreenChange(): if self.env['runtime']['screenManager'].isScreenChange():
self.lastIdent = 0 self.lastIdent = 0
return return
# this leads to problems in vim -> status line change -> no announcement, so we do check the lengh as hack # 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 self.env['runtime']['screenManager'].isDelta():
return return
# is a vertical change? # is a vertical change?
if not self.env['runtime']['cursorManager'].isCursorVerticalMove(): if not self.env['runtime']['cursorManager'].isCursorVerticalMove():
return return
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText']) x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
if currLine.isspace(): if currLine.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False) self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else: else:
# ident # ident
currIdent = len(currLine) - len(currLine.lstrip()) currIdent = len(currLine) - len(currLine.lstrip())
if self.lastIdent == -1: if self.lastIdent == -1:
self.lastIdent = currIdent self.lastIdent = currIdent
doInterrupt = True doInterrupt = True
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'): if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
if self.lastIdent != currIdent: if self.lastIdent != currIdent:
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False) self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
doInterrupt = False doInterrupt = False
# barrier # barrier
sayLine = currLine sayLine = currLine
if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'): if self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y']) isBarrier, barrierLine = self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
if isBarrier: if isBarrier:
sayLine = barrierLine sayLine = barrierLine
# output # output
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False) self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
self.lastIdent = currIdent self.lastIdent = currIdent
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,34 +1,34 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import screen_utils from fenrirscreenreader.utils import screen_utils
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('Reads attributes of current cursor position') return _('Reads attributes of current cursor position')
def run(self): def run(self):
# is it enabled? # is it enabled?
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'): if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
return return
# is a vertical change? # is a vertical change?
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\ if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
self.env['runtime']['cursorManager'].isCursorHorizontalMove()): self.env['runtime']['cursorManager'].isCursorHorizontalMove()):
return return
cursorPos = self.env['screen']['newCursor'] cursorPos = self.env['screen']['newCursor']
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos): if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
return return
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False) self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('exits review mode') return _('exits review mode')
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'): if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnCursorChange'):
return return
if self.env['runtime']['cursorManager'].isReviewMode(): if self.env['runtime']['cursorManager'].isReviewMode():
self.env['runtime']['cursorManager'].clearReviewCursor() self.env['runtime']['cursorManager'].clearReviewCursor()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,29 +1,29 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import time import time
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import time import time
import datetime import datetime
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
self.lastTime = datetime.datetime.now() self.lastTime = datetime.datetime.now()
self.lastDateString = '' self.lastDateString = ''
self.lastTimeString = '' self.lastTimeString = ''
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
self.env['runtime']['screenDriver'].getSessionInformation() self.env['runtime']['screenDriver'].getSessionInformation()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,85 +1,85 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import time import time
import datetime import datetime
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
self.lastTime = datetime.datetime.now() self.lastTime = datetime.datetime.now()
self.lastDateString = '' self.lastDateString = ''
self.lastTimeString = '' self.lastTimeString = ''
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'): if not self.env['runtime']['settingsManager'].getSettingAsBool('time', 'enabled'):
return return
onMinutes = self.env['runtime']['settingsManager'].getSetting('time', 'onMinutes') onMinutes = self.env['runtime']['settingsManager'].getSetting('time', 'onMinutes')
delaySec = self.env['runtime']['settingsManager'].getSettingAsInt('time', 'delaySec') delaySec = self.env['runtime']['settingsManager'].getSettingAsInt('time', 'delaySec')
# no need # no need
if onMinutes == '' and delaySec <= 0: if onMinutes == '' and delaySec <= 0:
return return
onMinutes = onMinutes.split(',') onMinutes = onMinutes.split(',')
now = datetime.datetime.now() now = datetime.datetime.now()
# ignore onMinutes if there is a delaySec # ignore onMinutes if there is a delaySec
if delaySec > 0: if delaySec > 0:
if int((now - self.lastTime).total_seconds()) < delaySec: if int((now - self.lastTime).total_seconds()) < delaySec:
return return
else: else:
# should announce? # should announce?
if not str(now.minute).zfill(2) in onMinutes: if not str(now.minute).zfill(2) in onMinutes:
return return
# already announced? # already announced?
if now.hour == self.lastTime.hour: if now.hour == self.lastTime.hour:
if now.minute == self.lastTime.minute: if now.minute == self.lastTime.minute:
return return
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat') dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
dateString = datetime.datetime.strftime(now, dateFormat) dateString = datetime.datetime.strftime(now, dateFormat)
presentDate = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentDate') and \ presentDate = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentDate') and \
self.lastDateString != dateString self.lastDateString != dateString
presentTime = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentTime') presentTime = self.env['runtime']['settingsManager'].getSettingAsBool('time', 'presentTime')
# no changed value to announce # no changed value to announce
if not (presentDate or presentTime): if not (presentDate or presentTime):
return return
timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat') timeFormat = self.env['runtime']['settingsManager'].getSetting('general', 'timeFormat')
timeString = datetime.datetime.strftime(now, timeFormat) timeString = datetime.datetime.strftime(now, timeFormat)
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'interrupt'): if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'interrupt'):
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'announce'): if self.env['runtime']['settingsManager'].getSettingAsBool('time', 'announce'):
self.env['runtime']['outputManager'].playSoundIcon('announce') self.env['runtime']['outputManager'].playSoundIcon('announce')
if presentTime: if presentTime:
# present the time # present the time
self.env['runtime']['outputManager'].presentText(_("It's {0}").format(timeString.replace(':00', " O'clock ").lstrip('0')), soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(_("It's {0}").format(timeString.replace(':00', " O'clock ").lstrip('0')), soundIcon='', interrupt=False)
# Check if it's 12:00 AM # Check if it's 12:00 AM
if now.hour == 0 and now.minute == 0: if now.hour == 0 and now.minute == 0:
# present the date # present the date
self.env['runtime']['outputManager'].presentText(dateString, soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(dateString, soundIcon='', interrupt=False)
self.lastTime = datetime.datetime.now() self.lastTime = datetime.datetime.now()
self.lastTimeString = timeString self.lastTimeString = timeString
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,26 +1,26 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import time import time
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import time import time
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
print(time.time()) print(time.time())
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,37 +1,37 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'): if not self.env['runtime']['settingsManager'].getSettingAsBool('keyboard', 'interruptOnKeyPress'):
return return
if self.env['runtime']['inputManager'].noKeyPressed(): if self.env['runtime']['inputManager'].noKeyPressed():
return return
if self.env['runtime']['screenManager'].isScreenChange(): if self.env['runtime']['screenManager'].isScreenChange():
return return
if len(self.env['input']['currInput']) <= len(self.env['input']['prevInput']): if len(self.env['input']['currInput']) <= len(self.env['input']['prevInput']):
return return
# if the filter is set # if the filter is set
if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '': if self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').strip() != '':
filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',') filterList = self.env['runtime']['settingsManager'].getSetting('keyboard', 'interruptOnKeyPressFilter').split(',')
for currInput in self.env['input']['currInput']: for currInput in self.env['input']['currInput']:
if not currInput in filterList: if not currInput in filterList:
return return
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,31 +1,31 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return _('disables speech until next keypress') return _('disables speech until next keypress')
def run(self): def run(self):
if self.env['runtime']['inputManager'].noKeyPressed(): if self.env['runtime']['inputManager'].noKeyPressed():
return return
if len(self.env['input']['prevInput']) >0: if len(self.env['input']['prevInput']) >0:
return return
if not self.env['commandBuffer']['enableSpeechOnKeypress']: if not self.env['commandBuffer']['enableSpeechOnKeypress']:
return return
self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress'])) self.env['runtime']['settingsManager'].setSetting('speech', 'enabled', str(self.env['commandBuffer']['enableSpeechOnKeypress']))
self.env['commandBuffer']['enableSpeechOnKeypress'] = False self.env['commandBuffer']['enableSpeechOnKeypress'] = False
self.env['runtime']['outputManager'].presentText(_("speech enabled"), soundIcon='SpeechOn', interrupt=True) self.env['runtime']['outputManager'].presentText(_("speech enabled"), soundIcon='SpeechOn', interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,27 +1,27 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No description found' return 'No description found'
def run(self): def run(self):
if self.env['input']['oldCapsLock'] == self.env['input']['newCapsLock']: if self.env['input']['oldCapsLock'] == self.env['input']['newCapsLock']:
return return
if self.env['input']['newCapsLock']: if self.env['input']['newCapsLock']:
self.env['runtime']['outputManager'].presentText(_("Capslock on"), interrupt=True) self.env['runtime']['outputManager'].presentText(_("Capslock on"), interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_("Capslock off"), interrupt=True) self.env['runtime']['outputManager'].presentText(_("Capslock off"), interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,27 +1,27 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No description found' return 'No description found'
def run(self): def run(self):
if self.env['input']['oldScrollLock'] == self.env['input']['newScrollLock']: if self.env['input']['oldScrollLock'] == self.env['input']['newScrollLock']:
return return
if self.env['input']['newScrollLock']: if self.env['input']['newScrollLock']:
self.env['runtime']['outputManager'].presentText(_("Scrolllock on"), interrupt=True) self.env['runtime']['outputManager'].presentText(_("Scrolllock on"), interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_("Scrolllock off"), interrupt=True) self.env['runtime']['outputManager'].presentText(_("Scrolllock off"), interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,27 +1,27 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No description found' return 'No description found'
def run(self): def run(self):
if self.env['input']['oldNumLock'] == self.env['input']['newNumLock']: if self.env['input']['oldNumLock'] == self.env['input']['newNumLock']:
return return
if self.env['input']['newNumLock']: if self.env['input']['newNumLock']:
self.env['runtime']['outputManager'].presentText(_("Numlock on"), interrupt=True) self.env['runtime']['outputManager'].presentText(_("Numlock on"), interrupt=True)
else: else:
self.env['runtime']['outputManager'].presentText(_("Numlock off"), interrupt=True) self.env['runtime']['outputManager'].presentText(_("Numlock off"), interrupt=True)
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,23 +1,23 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No description found' return 'No description found'
def run(self): def run(self):
if self.env['runtime']['helpManager'].isTutorialMode(): if self.env['runtime']['helpManager'].isTutorialMode():
self.env['runtime']['inputManager'].keyEcho() self.env['runtime']['inputManager'].keyEcho()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,34 +1,34 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
import time import time
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
self.lastTime = time.time() self.lastTime = time.time()
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No description found' return 'No description found'
def run(self): def run(self):
playSound = False playSound = False
deviceList = self.env['runtime']['inputManager'].getLastDetectedDevices() deviceList = self.env['runtime']['inputManager'].getLastDetectedDevices()
try: try:
for deviceEntry in deviceList: for deviceEntry in deviceList:
# dont play sounds for virtual devices # dont play sounds for virtual devices
playSound = playSound or not deviceEntry['virtual'] playSound = playSound or not deviceEntry['virtual']
except: except:
playSound = True playSound = True
if playSound: if playSound:
if time.time() - self.lastTime > 5: if time.time() - self.lastTime > 5:
self.env['runtime']['outputManager'].playSoundIcon(soundIcon = 'accept', interrupt=True) self.env['runtime']['outputManager'].playSoundIcon(soundIcon = 'accept', interrupt=True)
lastTime = time.time() lastTime = time.time()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,23 +1,23 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return '' return ''
def run(self): def run(self):
self.env['runtime']['outputManager'].interruptOutput() self.env['runtime']['outputManager'].interruptOutput()
def setCallback(self, callback): def setCallback(self, callback):
pass pass

View File

@ -1,27 +1,27 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers. # By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug from fenrirscreenreader.core import debug
class command(): class command():
def __init__(self): def __init__(self):
pass pass
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
def shutdown(self): def shutdown(self):
pass pass
def getDescription(self): def getDescription(self):
return 'No Description found' return 'No Description found'
def run(self): def run(self):
if not self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'): if not self.env['runtime']['settingsManager'].getSettingAsBool('barrier','enabled'):
return return
self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y']) self.env['runtime']['barrierManager'].handleLineBarrier(self.env['screen']['newContentText'].split('\n'), self.env['screen']['newCursor']['x'],self.env['screen']['newCursor']['y'])
def setCallback(self, callback): def setCallback(self, callback):
pass pass

Some files were not shown because too many files have changed in this diff Show More