replaces namespace fenrir with fenrirscreenreader
This commit is contained in:
parent
7535ba7e00
commit
40da178136
48
install.sh
48
install.sh
@ -3,54 +3,54 @@
|
|||||||
read -p "This will install Fenrir. Press ctrl+C to cancel, or enter to continue." continue
|
read -p "This will install Fenrir. Press ctrl+C to cancel, or enter to continue." continue
|
||||||
|
|
||||||
# Fenrir main application
|
# Fenrir main application
|
||||||
install -m755 -d /opt/fenrir
|
install -m755 -d /opt/fenrirscreenreader
|
||||||
cp -af src/fenrir/* /opt/fenrir
|
cp -af src/* /opt/fenrirscreenreader
|
||||||
install -m644 -D "autostart/systemd/fenrir.service" /usr/lib/systemd/system/fenrir.service
|
install -m644 -D "autostart/systemd/fenrir.service" /usr/lib/systemd/system/fenrir.service
|
||||||
ln -fs /opt/fenrir/fenrir-daemon /usr/bin/fenrir-daemon
|
ln -fs /opt/fenrirscreenreader/fenrir-daemon /usr/bin/fenrir-daemon
|
||||||
ln -fs /opt/fenrir/fenrir /usr/bin/fenrir
|
ln -fs /opt/fenrirscreenreader/fenrir /usr/bin/fenrir
|
||||||
# tools
|
# tools
|
||||||
install -m755 -d /usr/share/fenrir/tools
|
install -m755 -d /usr/share/fenrirscreenreader/tools
|
||||||
cp -af tools/* /usr/share/fenrir/tools
|
cp -af tools/* /usr/share/fenrirscreenreader/tools
|
||||||
|
|
||||||
# scripts
|
# scripts
|
||||||
install -m755 -d /usr/share/fenrir/scripts
|
install -m755 -d /usr/share/fenrirscreenreader/scripts
|
||||||
cp -af "config/scripts/wlan__-__key_y.sh" /usr/share/fenrir/scripts/
|
cp -af "config/scripts/wlan__-__key_y.sh" /usr/share/fenrirscreenreader/scripts/
|
||||||
|
|
||||||
# keyboard
|
# keyboard
|
||||||
install -m644 -D "config/keyboard/desktop.conf" /etc/fenrir/keyboard/desktop.conf
|
install -m644 -D "config/keyboard/desktop.conf" /etc/fenrirscreenreader/keyboard/desktop.conf
|
||||||
install -m644 -D "config/keyboard/laptop.conf" /etc/fenrir/keyboard/laptop.conf
|
install -m644 -D "config/keyboard/laptop.conf" /etc/fenrirscreenreader/keyboard/laptop.conf
|
||||||
|
|
||||||
# punctuation
|
# punctuation
|
||||||
install -m755 -d /etc/fenrir/punctuation
|
install -m755 -d /etc/fenrirscreenreader/punctuation
|
||||||
cp -af config/punctuation/* /etc/fenrir/punctuation
|
cp -af config/punctuation/* /etc/fenrirscreenreader/punctuation
|
||||||
|
|
||||||
# sound
|
# sound
|
||||||
install -d /usr/share/sounds/fenrir
|
install -d /usr/share/sounds/fenrirscreenreader
|
||||||
cp -af config/sound/default /usr/share/sounds/fenrir/default
|
cp -af config/sound/default /usr/share/sounds/fenrirscreenreader/default
|
||||||
cp -af config/sound/default-wav /usr/share/sounds/fenrir/default-wav
|
cp -af config/sound/default-wav /usr/share/sounds/fenrirscreenreader/default-wav
|
||||||
cp -af config/sound/template /usr/share/sounds/fenrir/template
|
cp -af config/sound/template /usr/share/sounds/fenrirscreenreader/template
|
||||||
|
|
||||||
# config
|
# config
|
||||||
if [ -f "/etc/fenrir/settings/settings.conf" ]; then
|
if [ -f "/etc/fenrirscreenreader/settings/settings.conf" ]; then
|
||||||
echo "Do you want to overwrite your current global settings? (y/n)"
|
echo "Do you want to overwrite your current global settings? (y/n)"
|
||||||
read yn
|
read yn
|
||||||
if [ $yn = "Y" -o $yn = "y" ]; then
|
if [ $yn = "Y" -o $yn = "y" ]; then
|
||||||
mv /etc/fenrir/settings/settings.conf /etc/fenrir/settings/settings.conf.bak
|
mv /etc/fenrirscreenreader/settings/settings.conf /etc/fenrirscreenreader/settings/settings.conf.bak
|
||||||
echo "Your old settings.conf has been backed up to settings.conf.bak."
|
echo "Your old settings.conf has been backed up to settings.conf.bak."
|
||||||
install -m644 -D "config/settings/settings.conf" /etc/fenrir/settings/settings.conf
|
install -m644 -D "config/settings/settings.conf" /etc/fenrirscreenreader/settings/settings.conf
|
||||||
else
|
else
|
||||||
install -m644 -D "config/settings/settings.conf" /etc/fenrir/settings/settings.conf.current
|
install -m644 -D "config/settings/settings.conf" /etc/fenrirscreenreader/settings/settings.conf.current
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
install -m644 -D "config/settings/settings.conf" /etc/fenrir/settings/settings.conf
|
install -m644 -D "config/settings/settings.conf" /etc/fenrirscreenreader/settings/settings.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# end message
|
# end message
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Installation complete.
|
Installation complete.
|
||||||
install path:/opt/fenrir
|
install path:/opt/fenrirscreenreader
|
||||||
settings path:/etc/fenrir
|
settings path:/etc/fenrirscreenreader
|
||||||
|
|
||||||
To test Fenrir
|
To test Fenrir
|
||||||
sudo systemctl start fenrir
|
sudo systemctl start fenrir
|
||||||
@ -58,6 +58,6 @@ To have Fenrir start on system boot:
|
|||||||
sudo systemctl enable fenrir
|
sudo systemctl enable fenrir
|
||||||
|
|
||||||
Pulseaudio users may want to run
|
Pulseaudio users may want to run
|
||||||
/usr/share/fenrir/tools/configure_pulse.sh
|
/usr/share/fenrirscreenreader/tools/configure_pulse.sh
|
||||||
once from their user account, then once from the root.
|
once from their user account, then once from the root.
|
||||||
EOF
|
EOF
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
#from core import debug
|
#from fenrirscreenreader.core import debug
|
||||||
import string
|
import string
|
||||||
# X Y Word END BREAK
|
# X Y Word END BREAK
|
||||||
# -1, -1, '', True False
|
# -1, -1, '', True False
|
||||||
|
32
setup.py
32
setup.py
@ -6,8 +6,8 @@ from shutil import copyfile
|
|||||||
from setuptools import find_packages
|
from setuptools import find_packages
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
fenrirVersion = '1.5'
|
fenrirVersion = '1.6'
|
||||||
packageVersion = 'post11'
|
packageVersion = 'post1'
|
||||||
|
|
||||||
# handle flags for package manager like yaourt and pacaur.
|
# handle flags for package manager like yaourt and pacaur.
|
||||||
forceSettings = False
|
forceSettings = False
|
||||||
@ -21,32 +21,32 @@ for directory in directories:
|
|||||||
files = glob.glob(directory+'/*')
|
files = glob.glob(directory+'/*')
|
||||||
destDir = ''
|
destDir = ''
|
||||||
if 'config/punctuation' in directory :
|
if 'config/punctuation' in directory :
|
||||||
destDir = '/etc/fenrir/punctuation'
|
destDir = '/etc/fenrirscreenreader/punctuation'
|
||||||
elif 'config/keyboard' in directory:
|
elif 'config/keyboard' in directory:
|
||||||
destDir = '/etc/fenrir/keyboard'
|
destDir = '/etc/fenrirscreenreader/keyboard'
|
||||||
elif 'config/settings' in directory:
|
elif 'config/settings' in directory:
|
||||||
destDir = '/etc/fenrir/settings'
|
destDir = '/etc/fenrirscreenreader/settings'
|
||||||
if not forceSettings:
|
if not forceSettings:
|
||||||
try:
|
try:
|
||||||
del(files[files.index('config/settings/settings.conf')])
|
del(files[files.index('config/settings/settings.conf')])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
elif 'config/scripts' in directory:
|
elif 'config/scripts' in directory:
|
||||||
destDir = '/usr/share/fenrir/scripts'
|
destDir = '/usr/share/fenrirscreenreader/scripts'
|
||||||
if destDir != '':
|
if destDir != '':
|
||||||
data_files.append((destDir, files))
|
data_files.append((destDir, files))
|
||||||
|
|
||||||
files = glob.glob('config/sound/default-wav/*')
|
files = glob.glob('config/sound/default-wav/*')
|
||||||
destDir = '/usr/share/sounds/fenrir/default-wav'
|
destDir = '/usr/share/sounds/fenrirscreenreader/default-wav'
|
||||||
data_files.append((destDir, files))
|
data_files.append((destDir, files))
|
||||||
files = glob.glob('config/sound/default/*')
|
files = glob.glob('config/sound/default/*')
|
||||||
destDir = '/usr/share/sounds/fenrir/default'
|
destDir = '/usr/share/sounds/fenrirscreenreader/default'
|
||||||
data_files.append((destDir, files))
|
data_files.append((destDir, files))
|
||||||
files = glob.glob('config/sound//template/*')
|
files = glob.glob('config/sound//template/*')
|
||||||
destDir = '/usr/share/sounds/fenrir/template'
|
destDir = '/usr/share/sounds/fenrirscreenreader/template'
|
||||||
data_files.append((destDir, files))
|
data_files.append((destDir, files))
|
||||||
files = glob.glob('tools/*')
|
files = glob.glob('tools/*')
|
||||||
data_files.append(('/usr/share/fenrir/tools', files))
|
data_files.append(('/usr/share/fenrirscreenreader/tools', files))
|
||||||
data_files.append(('/usr/lib/systemd/system', ['autostart/systemd/fenrir.service']))
|
data_files.append(('/usr/lib/systemd/system', ['autostart/systemd/fenrir.service']))
|
||||||
data_files.append(('/usr/share/man/man1', ['docu/fenrir.1']))
|
data_files.append(('/usr/share/man/man1', ['docu/fenrir.1']))
|
||||||
|
|
||||||
@ -78,9 +78,9 @@ setup(
|
|||||||
author_email="chrysg@linux-a11y.org",
|
author_email="chrysg@linux-a11y.org",
|
||||||
|
|
||||||
# Packages
|
# Packages
|
||||||
packages=find_packages('src/fenrir'),
|
packages=find_packages('src/fenrirscreenreader'),
|
||||||
package_dir={'': 'src/fenrir'},
|
package_dir={'': 'src/fenrirscreenreader'},
|
||||||
scripts=['src/fenrir/fenrir','src/fenrir/fenrir-daemon'],
|
scripts=['src/fenrir','src/fenrir-daemon'],
|
||||||
|
|
||||||
# Include additional files into the package
|
# Include additional files into the package
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
@ -105,9 +105,9 @@ setup(
|
|||||||
if not forceSettings:
|
if not forceSettings:
|
||||||
print('')
|
print('')
|
||||||
# create settings file from example if not exist
|
# create settings file from example if not exist
|
||||||
if not os.path.isfile('/etc/fenrir/settings/settings.conf'):
|
if not os.path.isfile('/etc/fenrirscreenreader/settings/settings.conf'):
|
||||||
try:
|
try:
|
||||||
copyfile('/etc/fenrir/settings/settings.conf.example', '/etc/fenrir/settings/settings.conf')
|
copyfile('/etc/fenrirscreenreader/settings/settings.conf.example', '/etc/fenrir/settings/settings.conf')
|
||||||
print('create settings file in /etc/fenrir/settings/settings.conf')
|
print('create settings file in /etc/fenrir/settings/settings.conf')
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -118,7 +118,7 @@ print('')
|
|||||||
print('To have Fenrir start at boot:')
|
print('To have Fenrir start at boot:')
|
||||||
print('sudo systemctl enable fenrir')
|
print('sudo systemctl enable fenrir')
|
||||||
print('Pulseaudio users may want to run:')
|
print('Pulseaudio users may want to run:')
|
||||||
print('/usr/share/fenrir/tools/configure_pulse.sh')
|
print('/usr/share/fenrirscreenreader/tools/configure_pulse.sh')
|
||||||
print('once as their user account and once as root to configure Pulseaudio.')
|
print('once as their user account and once as root to configure Pulseaudio.')
|
||||||
print('Please install the following packages manually:')
|
print('Please install the following packages manually:')
|
||||||
print('- Speech-dispatcher: for the default speech driver')
|
print('- Speech-dispatcher: for the default speech driver')
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from core.brailleDriver import brailleDriver
|
|
||||||
|
|
||||||
class driver(brailleDriver):
|
|
||||||
def __init__(self):
|
|
||||||
brailleDriver.__init__(self)
|
|
||||||
self._brl = None
|
|
||||||
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
try:
|
|
||||||
import brlapi
|
|
||||||
self._brl = brlapi.Connection()
|
|
||||||
self._deviceSize = self._brl.displaySize
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
self.env['runtime']['debug'].writeDebugOut(str(e),debug.debugLevel.ERROR)
|
|
||||||
return
|
|
||||||
self._isInitialized = True
|
|
||||||
|
|
||||||
def getDeviceSize(self):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return (0,0)
|
|
||||||
if not self._deviceSize:
|
|
||||||
return (0,0)
|
|
||||||
return self._deviceSize
|
|
||||||
|
|
||||||
def flush(self):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return
|
|
||||||
try:
|
|
||||||
self._brl.writeText('',0)
|
|
||||||
except Exception as e:
|
|
||||||
self.env['runtime']['debug'].writeDebugOut('BRAILLE.flush '+str(e),debug.debugLevel.ERROR)
|
|
||||||
|
|
||||||
def writeText(self,text):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return
|
|
||||||
try:
|
|
||||||
self._brl.writeText(text)
|
|
||||||
except Exception as e:
|
|
||||||
self.env['runtime']['debug'].writeDebugOut('BRAILLE.writeText '+str(e),debug.debugLevel.ERROR)
|
|
||||||
|
|
||||||
def connectDevice(self):
|
|
||||||
self._brl = brlapi.Connection()
|
|
||||||
|
|
||||||
def enterScreen(self, screen):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return
|
|
||||||
self._brl.enterTtyMode(int(screen))
|
|
||||||
|
|
||||||
def leveScreen(self):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return
|
|
||||||
self._brl.leaveTtyMode()
|
|
||||||
|
|
||||||
def shutdown(self):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return
|
|
||||||
self.leveScreen()
|
|
@ -1,49 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from core.brailleDriver import brailleDriver
|
|
||||||
|
|
||||||
class driver(brailleDriver):
|
|
||||||
def __init__(self):
|
|
||||||
brailleDriver.__init__(self)
|
|
||||||
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self._isInitialized = True
|
|
||||||
self.deviceSize = (40,0)
|
|
||||||
print('Braille Debug Driver: Initialized')
|
|
||||||
|
|
||||||
def getDeviceSize(self):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return (0,0)
|
|
||||||
print('Braille Debug Driver: getDeviceSize ' + str(self.deviceSize))
|
|
||||||
return self.deviceSize
|
|
||||||
|
|
||||||
def writeText(self,text):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return
|
|
||||||
print('Braille Debug Driver: writeText:' + str(text))
|
|
||||||
print('Braille Debug Driver: -----------------------------------')
|
|
||||||
|
|
||||||
def connectDevice(self):
|
|
||||||
print('Braille Debug Driver: connectDevice')
|
|
||||||
|
|
||||||
def enterScreen(self, screen):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return
|
|
||||||
print('Braille Debug Driver: enterScreen')
|
|
||||||
|
|
||||||
def leveScreen(self):
|
|
||||||
if not self._isInitialized:
|
|
||||||
return
|
|
||||||
print('Braille Debug Driver: leveScreen')
|
|
||||||
|
|
||||||
def shutdown(self):
|
|
||||||
if self._isInitialized:
|
|
||||||
self.leveScreen()
|
|
||||||
self._isInitialized = False
|
|
||||||
print('Braille Debug Driver: Shutdown')
|
|
@ -1,12 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from core.brailleDriver import brailleDriver
|
|
||||||
|
|
||||||
class driver(brailleDriver):
|
|
||||||
def __init__(self):
|
|
||||||
brailleDriver.__init__(self)
|
|
@ -1,21 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return 'No description found'
|
|
||||||
def run(self):
|
|
||||||
pass
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,26 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
# this command is just to initialize stuff.
|
|
||||||
# like init index lists in memoryManager
|
|
||||||
# it is not useful to execute it
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
# clipboard
|
|
||||||
self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards'))
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return 'No description found'
|
|
||||||
def run(self):
|
|
||||||
pass
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,55 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import word_utils
|
|
||||||
import string
|
|
||||||
initialized = False
|
|
||||||
try:
|
|
||||||
import enchant
|
|
||||||
initialized = True
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.language = ''
|
|
||||||
self.spellChecker = None
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.updateSpellLanguage()
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('adds the current word to the exceptions dictionary')
|
|
||||||
def updateSpellLanguage(self):
|
|
||||||
self.spellChecker = enchant.Dict(self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage'))
|
|
||||||
self.language = self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not initialized:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('pyenchant is not installed'), interrupt=True)
|
|
||||||
return
|
|
||||||
if self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage') != self.language:
|
|
||||||
try:
|
|
||||||
self.updateSpellLanguage()
|
|
||||||
except Exception as e:
|
|
||||||
return
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
# get the word
|
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[cursorPos['y']]
|
|
||||||
x, y, currWord, endOfScreen, lineBreak = word_utils.getCurrentWord(cursorPos['x'], 0, newContent)
|
|
||||||
currWord = currWord.strip(string.whitespace + '!"#$%&\()*+,-./:;<=§>?@[\\]^_{|}~')
|
|
||||||
|
|
||||||
if currWord != '':
|
|
||||||
if self.spellChecker.is_added(currWord):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('{0} is already in dict').format(currWord,), soundIcon='Cancel', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.spellChecker.add(currWord)
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('{0} added').format(currWord,), soundIcon='Accept', interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import screen_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return 'No description found'
|
|
||||||
def run(self):
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
attributes = screen_utils.splitEvery(self.env['screen']['newContentAttrib'], self.env['screen']['columns'])
|
|
||||||
attributes = attributes[cursorPos['y']][cursorPos['x']]
|
|
||||||
attributeFormatString = self.env['runtime']['settingsManager'].getSetting('general', 'attributeFormatString')
|
|
||||||
attributeFormatString = self.env['runtime']['screenManager'].formatAttributes(attributes, attributeFormatString)
|
|
||||||
self.env['runtime']['outputManager'].presentText(attributeFormatString, soundIcon='', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '1'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '10'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '2'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '3'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '4'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '5'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '6'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '7'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '8'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '9'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set').format(self.ID,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark for application {0} not set').format(currApp,), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# set marks
|
|
||||||
marked = ''
|
|
||||||
startMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'].copy()
|
|
||||||
if self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2']:
|
|
||||||
endMark = self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'].copy()
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
else:
|
|
||||||
x, y, marked = \
|
|
||||||
line_utils.getCurrentLine(startMark['x'], startMark['y'], self.env['screen']['newContentText'])
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('blank'), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,21 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('flush the braille device if a message is written on')
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['outputManager'].clearFlushTime()
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,21 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('Move braille view to the left.')
|
|
||||||
def run(self):
|
|
||||||
panned = self.env['runtime']['outputManager'].setPanLeft()
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,21 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('Move braille view to the right.')
|
|
||||||
def run(self):
|
|
||||||
panned = self.env['runtime']['outputManager'].setPanRight()
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,21 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('Set the braille view back to cursor.')
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['outputManager'].removePanning()
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '1'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '10'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '2'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '3'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '4'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '5'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '6'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '7'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '8'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.ID = '9'
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('remove Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
|
|
||||||
del self.env['commandBuffer']['bookMarks'][self.ID][currApp]
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} removed for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,24 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('clears the currently selected clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['memoryManager'].clearCurrentIndexList('clipboardHistory')
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard cleared'), interrupt=True)
|
|
||||||
return
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('Turn off window mode for application')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.env['runtime']['cursorManager'].clearWindowForApplication():
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Window Mode off for application {0}').format(currApp,), interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("Not in window Mode"), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,26 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('copies last presented text to the clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
lastEcho = self.env['runtime']['outputManager'].getLastEcho()
|
|
||||||
self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', lastEcho)
|
|
||||||
self.env['runtime']['outputManager'].presentText(lastEcho, soundIcon='CopyToClipboard', interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('copies marked text to the currently selected clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("one or two marks needed"), interrupt=True)
|
|
||||||
return
|
|
||||||
if not self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['runtime']['cursorManager'].setMark()
|
|
||||||
|
|
||||||
# use the last first and the last setted mark as range
|
|
||||||
startMark = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
endMark = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', marked)
|
|
||||||
# reset marks
|
|
||||||
self.env['runtime']['cursorManager'].clearMarks()
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, soundIcon='CopyToClipboard', interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('speaks the contents of the currently selected clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
|
||||||
return
|
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard , interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,26 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('reads the contents of the current screen')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.env['screen']['newContentText'].isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("screen is empty"), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newContentText'],interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,32 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('reads from the cursor to the bottom of the screen')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
# Prefer review cursor over text cursor
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
|
|
||||||
textAfterCursor = mark_utils.getTextAfterMark(cursorPos, self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if textAfterCursor.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(textAfterCursor, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('Reads from the top of the screen to the cursor position')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
# Prefer review cursor over text cursor
|
|
||||||
if self.env['screen']['newCursorReview']:
|
|
||||||
cursorPos = self.env['screen']['newCursorReview'].copy()
|
|
||||||
else:
|
|
||||||
cursorPos = self.env['screen']['newCursor'].copy()
|
|
||||||
|
|
||||||
textBeforeCursor = mark_utils.getTextBeforeMark(cursorPos, self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if textBeforeCursor.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(textBeforeCursor, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('presents the current column number for review cursor in review mode or the text cursor if not. Starts with 1')
|
|
||||||
def run(self):
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
self.env['runtime']['outputManager'].presentText(str(cursorPos['x'] + 1) , interrupt=True)
|
|
||||||
self.env['runtime']['outputManager'].announceActiveCursor()
|
|
||||||
self.env['runtime']['outputManager'].presentText(' column number' , interrupt=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,25 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('presents the current line number for review cursor in review mode or the text cursor if not. Starts with 1')
|
|
||||||
def run(self):
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
self.env['runtime']['outputManager'].presentText(str(cursorPos['y'] + 1), interrupt=True)
|
|
||||||
self.env['runtime']['outputManager'].announceActiveCursor()
|
|
||||||
self.env['runtime']['outputManager'].presentText(' line number' , interrupt=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,26 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('displays the position of the review cursor')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
# Prefer review cursor over text cursor
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("line {0}, column {1}").format(cursorPos['y']+1, cursorPos['x']+1), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('read to end of line, use review cursor if you are in review mode, otherwhise use text cursor')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
|
|
||||||
x, y, currLine = \
|
|
||||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if currLine.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(currLine[cursorPos['x']], interrupt=True)
|
|
||||||
self.env['runtime']['outputManager'].announceActiveCursor()
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import datetime
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('presents the date')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
dateFormat = self.env['runtime']['settingsManager'].getSetting('general', 'dateFormat')
|
|
||||||
|
|
||||||
# get the time formatted
|
|
||||||
dateString = datetime.datetime.strftime(datetime.datetime.now(), dateFormat)
|
|
||||||
|
|
||||||
# present the time via speak and braile, there is no soundicon, interrupt the current speech
|
|
||||||
self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
initialized = False
|
|
||||||
try:
|
|
||||||
import alsaaudio
|
|
||||||
initialized = True
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _("Decrease system volume")
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not initialized:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('alsaaudio is not installed'), interrupt=True)
|
|
||||||
return
|
|
||||||
mixer = alsaaudio.Mixer()
|
|
||||||
value = mixer.getvolume()[0]
|
|
||||||
value = value - 5
|
|
||||||
if value < 5:
|
|
||||||
value = 5
|
|
||||||
mixer.setvolume(value)
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("{0} percent system volume").format(value), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import math
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('decrease sound volume')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
|
|
||||||
|
|
||||||
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
|
||||||
if value < 0.1:
|
|
||||||
value = 0.1
|
|
||||||
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)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import math
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('decreases the pitch of the speech')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')
|
|
||||||
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
|
||||||
if value < 0.0:
|
|
||||||
value = 0.0
|
|
||||||
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)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import math
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('decreases the rate of the speech')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate')
|
|
||||||
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
|
||||||
if value < 0.0:
|
|
||||||
value = 0.0
|
|
||||||
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)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,31 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import math
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('decreases the volume of the speech')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume')
|
|
||||||
value = round((math.ceil(10 * value) / 10) - 0.1, 2)
|
|
||||||
if value < 0.1:
|
|
||||||
value = 0.1
|
|
||||||
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)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('exits review mode')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['runtime']['cursorManager'].isReviewMode():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("Not in review mode"), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
self.env['runtime']['cursorManager'].clearReviewCursor()
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("leave review mode"), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import os
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment, scriptPath=''):
|
|
||||||
self.env = environment
|
|
||||||
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('export the current fenrir clipboard to a file')
|
|
||||||
def run(self):
|
|
||||||
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'])
|
|
||||||
clipboardFile = open(clipboardFilePath,'w')
|
|
||||||
try:
|
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
|
||||||
return
|
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
|
||||||
clipboardFile.write(clipboard)
|
|
||||||
clipboardFile.close()
|
|
||||||
os.chmod(clipboardFilePath, 0o666)
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard exported to file'), interrupt=True)
|
|
||||||
except Exception as e:
|
|
||||||
self.env['runtime']['debug'].writeDebugOut('export_clipboard_to_file:run: Filepath:'+ clipboardFile +' trace:' + str(e),debug.debugLevel.ERROR)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,50 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import subprocess, os
|
|
||||||
from subprocess import Popen, PIPE
|
|
||||||
import _thread
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment, scriptPath=''):
|
|
||||||
self.env = environment
|
|
||||||
self.scriptPath = scriptPath
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('export the current fenrir clipboard to X clipboard')
|
|
||||||
def run(self):
|
|
||||||
_thread.start_new_thread(self._threadRun , ())
|
|
||||||
|
|
||||||
def _threadRun(self):
|
|
||||||
try:
|
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
|
||||||
return
|
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
|
||||||
for display in range(10):
|
|
||||||
p = Popen('su ' + self.env['general']['currUser'] + ' -c "echo -n \\\"' + clipboard.replace('"','\\\\\\"') +'\\\" | xclip -d :' + str(display) + ' -selection c"' , stdout=PIPE, stderr=PIPE, shell=True)
|
|
||||||
stdout, stderr = p.communicate()
|
|
||||||
self.env['runtime']['outputManager'].interruptOutput()
|
|
||||||
#screenEncoding = self.env['runtime']['settingsManager'].getSetting('screen', 'encoding')
|
|
||||||
stderr = stderr.decode('utf-8')
|
|
||||||
stdout = stdout.decode('utf-8')
|
|
||||||
if (stderr == ''):
|
|
||||||
break
|
|
||||||
#stderr = stderr.decode(screenEncoding, "replace").encode('utf-8').decode('utf-8')
|
|
||||||
#stdout = stdout.decode(screenEncoding, "replace").encode('utf-8').decode('utf-8')
|
|
||||||
if stderr != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(stderr , soundIcon='', interrupt=False)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText('exported to the X session.', interrupt=True)
|
|
||||||
except Exception as e:
|
|
||||||
self.env['runtime']['outputManager'].presentText(e , soundIcon='', interrupt=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,28 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('selects the first clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
|
||||||
return
|
|
||||||
self.env['runtime']['memoryManager'].setFirstIndex('clipboardHistory')
|
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,24 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('sends the following keypress to the terminal')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['input']['keyForeward'] = 3
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Forward next keypress'), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
import os
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('imports text from clipboard file to the clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
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'])
|
|
||||||
if not os.path.exists(clipboardFilePath):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('File does not exist'), soundIcon='', interrupt=True)
|
|
||||||
return
|
|
||||||
clipboardFile = open(clipboardFilePath,'r')
|
|
||||||
imported = clipboardFile.read()
|
|
||||||
clipboardFile.close()
|
|
||||||
self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', imported)
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText('Import to Clipboard', soundIcon='CopyToClipboard', interrupt=True)
|
|
||||||
self.env['runtime']['outputManager'].presentText(imported, soundIcon='', interrupt=False)
|
|
||||||
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
initialized = False
|
|
||||||
try:
|
|
||||||
import alsaaudio
|
|
||||||
initialized = True
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _("Increase system volume")
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not initialized:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('alsaaudio is not installed'), interrupt=True)
|
|
||||||
return
|
|
||||||
mixer = alsaaudio.Mixer()
|
|
||||||
value = mixer.getvolume()[0]
|
|
||||||
value = value + 5
|
|
||||||
if value > 100:
|
|
||||||
value = 100
|
|
||||||
mixer.setvolume(value)
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("{0} percent system volume").format(value), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,32 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import math
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('adjusts the volume for in coming sounds')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('sound', 'volume')
|
|
||||||
|
|
||||||
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
|
||||||
if value > 1.0:
|
|
||||||
value = 1.0
|
|
||||||
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)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import math
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('increases the pitch of the speech')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'pitch')
|
|
||||||
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
|
||||||
if value > 1.0:
|
|
||||||
value = 1.0
|
|
||||||
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)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import math
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('increase the speech rate')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'rate')
|
|
||||||
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
|
||||||
if value > 1.0:
|
|
||||||
value = 1.0
|
|
||||||
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)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import math
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('increase the speech volume')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
value = self.env['runtime']['settingsManager'].getSettingAsFloat('speech', 'volume')
|
|
||||||
value = round((math.ceil(10 * value) / 10) + 0.1, 2)
|
|
||||||
if value > 1.0:
|
|
||||||
value = 1.0
|
|
||||||
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)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('shows the indention level for the current line')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
# Prefer review cursor over text cursor
|
|
||||||
|
|
||||||
if self.env['screen']['newCursorReview']:
|
|
||||||
cursorPos = self.env['screen']['newCursorReview'].copy()
|
|
||||||
else:
|
|
||||||
cursorPos = self.env['screen']['newCursor'].copy()
|
|
||||||
x, y, currLine = \
|
|
||||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if currLine.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("indent {0}").format(len(currLine) - len(currLine.lstrip())), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,28 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('selects the last clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
|
||||||
return
|
|
||||||
self.env['runtime']['memoryManager'].setLastIndex('clipboardHistory')
|
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,23 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('displays the last received text')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,38 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import mark_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('speaks the currently selected text that will be copied to the clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not (self.env['commandBuffer']['Marks']['1'] and \
|
|
||||||
self.env['commandBuffer']['Marks']['2']):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("please set begin and endmark"), interrupt=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# use the last first and the last setted mark as range
|
|
||||||
startMark = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
endMark = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
|
|
||||||
marked = mark_utils.getTextBetweenMarks(startMark, endMark, self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if marked.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(marked, interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('selects the next clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
|
||||||
return
|
|
||||||
self.env['runtime']['memoryManager'].getNextIndex('clipboardHistory')
|
|
||||||
isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory')
|
|
||||||
isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory')
|
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
|
||||||
if isFirst:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True)
|
|
||||||
if isLast:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True)
|
|
||||||
|
|
||||||
speechInterrupt = not(isLast or isFirst)
|
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
import time
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['runtime']['memoryManager'].addIndexList('clipboardHistory', self.env['runtime']['settingsManager'].getSettingAsInt('general', 'numberOfClipboards'))
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('pastes the text from the currently selected clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
|
||||||
return
|
|
||||||
self.env['runtime']['outputManager'].presentText('paste clipboard', soundIcon='PasteClipboardOnScreen', interrupt=True)
|
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
|
||||||
self.env['runtime']['screenManager'].injectTextToScreen(clipboard)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('present first line')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
x, y, firstLine = \
|
|
||||||
line_utils.getCurrentLine(0, 0, self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if firstLine.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(firstLine, interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('current line')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
x, y, lastLine = \
|
|
||||||
line_utils.getCurrentLine(0, self.env['screen']['lines'] -1, self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if lastLine.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(lastLine, interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('selects the previous clipboard')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if self.env['runtime']['memoryManager'].isIndexListEmpty('clipboardHistory'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('clipboard empty'), interrupt=True)
|
|
||||||
return
|
|
||||||
self.env['runtime']['memoryManager'].setPrefIndex('clipboardHistory')
|
|
||||||
isFirst = self.env['runtime']['memoryManager'].isFirstIndex('clipboardHistory')
|
|
||||||
isLast = self.env['runtime']['memoryManager'].isLastIndex('clipboardHistory')
|
|
||||||
clipboard = self.env['runtime']['memoryManager'].getIndexListElement('clipboardHistory')
|
|
||||||
if isFirst:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('First clipboard '), interrupt=True)
|
|
||||||
if isLast:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Last clipboard '), interrupt=True)
|
|
||||||
speechInterrupt = not(isLast or isFirst)
|
|
||||||
self.env['runtime']['outputManager'].presentText(clipboard, interrupt = speechInterrupt)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,24 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('exits Fenrir')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['eventManager'].stopMainEventLoop()
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('removes marks from selected text')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].clearMarks()
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Remove marks'), interrupt=True)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,55 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import word_utils
|
|
||||||
import string
|
|
||||||
initialized = False
|
|
||||||
try:
|
|
||||||
import enchant
|
|
||||||
initialized = True
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
self.language = ''
|
|
||||||
self.spellChecker = None
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.updateSpellLanguage()
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('removes the current word from the exceptions dictionary')
|
|
||||||
def updateSpellLanguage(self):
|
|
||||||
self.spellChecker = enchant.Dict(self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage'))
|
|
||||||
self.language = self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not initialized:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('pyenchant is not installed'), interrupt=True)
|
|
||||||
return
|
|
||||||
if self.env['runtime']['settingsManager'].getSetting('general', 'spellCheckLanguage') != self.language:
|
|
||||||
try:
|
|
||||||
self.updateSpellLanguage()
|
|
||||||
except:
|
|
||||||
return
|
|
||||||
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
|
|
||||||
# get the word
|
|
||||||
newContent = self.env['screen']['newContentText'].split('\n')[cursorPos['y']]
|
|
||||||
x, y, currWord, endOfScreen, lineBreak = word_utils.getCurrentWord(cursorPos['x'], 0, newContent)
|
|
||||||
currWord = currWord.strip(string.whitespace + '!"#$%&\()*+,-./:;<=§>?@[\\]^_{|}~')
|
|
||||||
if not currWord.isspace():
|
|
||||||
if self.spellChecker.is_removed(currWord):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('{0} is already removed from dict').format(currWord,), soundIcon='Cancel', interrupt=True)
|
|
||||||
else:
|
|
||||||
self.spellChecker.remove(currWord)
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('{0} removed').format(currWord,), soundIcon='Accept', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,24 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('move review to bottom of screen')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['screen']['newCursorReview'] = { 'x': 0, 'y':self.env['screen']['lines'] -1}
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("Bottom"), interrupt=True, flush=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,29 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('presents the current character.')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
|
||||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set review and phonetically presents the current character')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
|
||||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if currChar.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
currChar = char_utils.getPhonetic(currChar)
|
|
||||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, announceCapital=True, flush=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,32 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('current line')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currLine = \
|
|
||||||
line_utils.getCurrentLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if currLine.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(currLine, interrupt=True, flush=False)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import word_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('current word.')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if currWord.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(currWord, interrupt=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,41 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import word_utils
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('phonetically spells the current word and set review to it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currWord, endOfScreen, lineBreak = \
|
|
||||||
word_utils.getCurrentWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if currWord.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
firstSequence = True
|
|
||||||
for c in currWord:
|
|
||||||
currChar = char_utils.getPhonetic(c)
|
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
|
|
||||||
firstSequence = False
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,29 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set review cursor to char below the current char and present it.')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], downChar, endOfScreen = \
|
|
||||||
char_utils.getDownChar(self.env['screen']['newCursorReview']['x'],self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
self.env['runtime']['outputManager'].presentText(downChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set review cursor to begin of current line and display the content')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
self.env['runtime']['cursorManager'].setReviewCursorPosition(0 ,cursorPos['y'])
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
|
||||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if currChar.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("beginning of line"), interrupt=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set review cursor to end of current line and display the content')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
self.env['runtime']['cursorManager'].setReviewCursorPosition(self.env['screen']['columns']-1 ,cursorPos['y'])
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
|
||||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("end of line"), interrupt=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import line_utils
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set review cursor to end of current line and display the content')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
x, y, currLine = \
|
|
||||||
line_utils.getCurrentLine(cursorPos['x'], cursorPos['y'], self.env['screen']['newContentText'])
|
|
||||||
if currLine.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("line is empty"), interrupt=True)
|
|
||||||
return
|
|
||||||
self.env['runtime']['cursorManager'].setReviewCursorPosition((len(currLine) - len(currLine.lstrip())), cursorPos['y'])
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], currChar = \
|
|
||||||
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("first char in line indent {0}").format(str(len(currLine) - len(currLine.lstrip()))), interrupt=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set review cursor to end of current line and display the content')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor()
|
|
||||||
self.env['runtime']['cursorManager'].setReviewCursorPosition(self.env['screen']['columns']-1 ,cursorPos['y'])
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], lastChar = \
|
|
||||||
char_utils.getLastCharInLine(self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(lastChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("last char in line"), interrupt=False)
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('moves review to the next character and presents it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextChar, endOfScreen, lineBreak = \
|
|
||||||
char_utils.getNextChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(nextChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,35 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('phonetically presents the next character and set review to it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextChar, endOfScreen, lineBreak = \
|
|
||||||
char_utils.getNextChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
nextChar = char_utils.getPhonetic(nextChar)
|
|
||||||
self.env['runtime']['outputManager'].presentText(nextChar ,interrupt=True, announceCapital=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('moves review to the next line and presents it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
|
||||||
if not self.env['screen']['newCursorReview']:
|
|
||||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextLine, endOfScreen = \
|
|
||||||
line_utils.getNextLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if nextLine.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(nextLine, interrupt=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import word_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('moves review to the next word and presents it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
|
||||||
if self.env['screen']['newCursorReview'] == None:
|
|
||||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
|
||||||
word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if nextWord.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(nextWord, interrupt=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,41 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import word_utils
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('phonetically spells the current word and set review to it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], nextWord, endOfScreen, lineBreak = \
|
|
||||||
word_utils.getNextWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if nextWord.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
firstSequence = True
|
|
||||||
for c in nextWord:
|
|
||||||
currChar = char_utils.getPhonetic(c)
|
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
|
|
||||||
firstSequence = False
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('moves review to the previous character and presents it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['screen']['oldCursorReview'] = self.env['screen']['newCursorReview']
|
|
||||||
if not self.env['screen']['newCursorReview']:
|
|
||||||
self.env['screen']['newCursorReview'] = self.env['screen']['newCursor'].copy()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevChar, endOfScreen, lineBreak = \
|
|
||||||
char_utils.getPrevChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
self.env['runtime']['outputManager'].presentText(prevChar, interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,35 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('phonetically presents the previous character and set review to it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevChar, endOfScreen, lineBreak = \
|
|
||||||
char_utils.getPrevChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
prevChar = char_utils.getPhonetic(prevChar)
|
|
||||||
self.env['runtime']['outputManager'].presentText(prevChar ,interrupt=True, announceCapital=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,35 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import line_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('moves review to the previous line and presents it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevLine, endOfScreen = \
|
|
||||||
line_utils.getPrevLine(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if prevLine.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(prevLine, interrupt=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,37 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import word_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('moves review focus to the previous word and presents it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
|
||||||
word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if prevWord.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(prevWord, interrupt=True, flush=False)
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=False, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,41 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
from utils import word_utils
|
|
||||||
from utils import char_utils
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('phonetically spells the current word and set review to it')
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
self.env['runtime']['cursorManager'].enterReviewModeCurrTextCursor()
|
|
||||||
self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], prevWord, endOfScreen, lineBreak = \
|
|
||||||
word_utils.getPrevWord(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
|
|
||||||
|
|
||||||
if prevWord.isspace():
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("blank"), interrupt=True, flush=False)
|
|
||||||
else:
|
|
||||||
firstSequence = True
|
|
||||||
for c in prevWord:
|
|
||||||
currChar = char_utils.getPhonetic(c)
|
|
||||||
self.env['runtime']['outputManager'].presentText(currChar, interrupt=firstSequence, announceCapital=True, flush=False)
|
|
||||||
firstSequence = False
|
|
||||||
if endOfScreen:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'endOfScreen'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
|
|
||||||
if lineBreak:
|
|
||||||
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user