Commit 2 of 2, code refactor and cleanup.
This commit is contained in:
@@ -0,0 +1,88 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Fenrir TTY screen reader
|
||||||
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import math
|
||||||
|
|
||||||
|
class AdjustmentCommand():
|
||||||
|
"""Base class for speech and sound adjustment commands"""
|
||||||
|
def __init__(self, section, setting, direction, step=0.1):
|
||||||
|
self.section = section # 'speech' or 'sound'
|
||||||
|
self.setting = setting # 'rate', 'pitch', 'volume'
|
||||||
|
self.direction = direction # 'inc' or 'dec'
|
||||||
|
self.step = step
|
||||||
|
|
||||||
|
def initialize(self, environment):
|
||||||
|
self.env = environment
|
||||||
|
|
||||||
|
def shutdown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def getDescription(self):
|
||||||
|
action = "Increase" if self.direction == 'inc' else "Decrease"
|
||||||
|
if self.section == 'speech':
|
||||||
|
return _(f'{action} the speech {self.setting}')
|
||||||
|
else:
|
||||||
|
return _(f'{action} the {self.section} {self.setting}')
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
if self.section == 'sound' and self.setting == 'volume':
|
||||||
|
# Sound volume uses different method
|
||||||
|
self._adjust_sound_volume()
|
||||||
|
else:
|
||||||
|
# Speech rate, pitch, volume use standard method
|
||||||
|
self._adjust_speech_setting()
|
||||||
|
|
||||||
|
def _adjust_speech_setting(self):
|
||||||
|
"""Adjust speech settings (rate, pitch, volume)"""
|
||||||
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat(self.section, self.setting)
|
||||||
|
|
||||||
|
# Apply adjustment with rounding
|
||||||
|
if self.direction == 'inc':
|
||||||
|
value = round((math.ceil(10 * value) / 10) + self.step, 2)
|
||||||
|
if value > 1.0:
|
||||||
|
value = 1.0
|
||||||
|
else: # dec
|
||||||
|
value = round((math.ceil(10 * value) / 10) - self.step, 2)
|
||||||
|
if value < 0.0:
|
||||||
|
value = 0.0
|
||||||
|
|
||||||
|
# Set the new value
|
||||||
|
self.env['runtime']['settingsManager'].setSetting(self.section, self.setting, str(value))
|
||||||
|
|
||||||
|
# Present feedback
|
||||||
|
percentage = int(value * 100)
|
||||||
|
if self.section == 'speech':
|
||||||
|
feedback = _("{0} percent speech {1}").format(percentage, self.setting)
|
||||||
|
else:
|
||||||
|
feedback = _("{0} percent {1} {2}").format(percentage, self.section, self.setting)
|
||||||
|
|
||||||
|
self.env['runtime']['outputManager'].presentText(feedback, soundIcon='', interrupt=True)
|
||||||
|
|
||||||
|
def _adjust_sound_volume(self):
|
||||||
|
"""Adjust sound volume using same logic as speech"""
|
||||||
|
value = self.env['runtime']['settingsManager'].getSettingAsFloat(self.section, self.setting)
|
||||||
|
|
||||||
|
# Sound volume uses same math as speech settings
|
||||||
|
if self.direction == 'inc':
|
||||||
|
value = round((math.ceil(10 * value) / 10) + self.step, 2)
|
||||||
|
if value > 1.0:
|
||||||
|
value = 1.0
|
||||||
|
else: # dec
|
||||||
|
value = round((math.ceil(10 * value) / 10) - self.step, 2)
|
||||||
|
if value < 0.0:
|
||||||
|
value = 0.0
|
||||||
|
|
||||||
|
# Set the new value
|
||||||
|
self.env['runtime']['settingsManager'].setSetting(self.section, self.setting, str(value))
|
||||||
|
|
||||||
|
# Present feedback with appropriate sound icon
|
||||||
|
percentage = int(value * 100)
|
||||||
|
sound_icon = 'SoundOn' if self.direction == 'inc' else 'SoundOff'
|
||||||
|
feedback = _("{0} percent sound volume").format(percentage)
|
||||||
|
self.env['runtime']['outputManager'].presentText(feedback, soundIcon=sound_icon, interrupt=True)
|
||||||
|
|
||||||
|
def setCallback(self, callback):
|
||||||
|
pass
|
||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '1'
|
super().__init__(1, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '10'
|
super().__init__(10, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '2'
|
super().__init__(2, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '3'
|
super().__init__(3, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '4'
|
super().__init__(4, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '5'
|
super().__init__(5, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '6'
|
super().__init__(6, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '7'
|
super().__init__(7, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '8'
|
super().__init__(8, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,44 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.utils import mark_utils
|
import os
|
||||||
from fenrirscreenreader.utils import line_utils
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '9'
|
super().__init__(9, 'read')
|
||||||
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
|
|
||||||
|
|||||||
@@ -0,0 +1,147 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Fenrir TTY screen reader
|
||||||
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
from fenrirscreenreader.utils import mark_utils
|
||||||
|
from fenrirscreenreader.utils import line_utils
|
||||||
|
|
||||||
|
class BookmarkCommand():
|
||||||
|
"""Base class for bookmark operations - read, set, clear"""
|
||||||
|
def __init__(self, bookmark_id, action='read'):
|
||||||
|
self.ID = str(bookmark_id)
|
||||||
|
self.action = action
|
||||||
|
|
||||||
|
def initialize(self, environment):
|
||||||
|
self.env = environment
|
||||||
|
# Always initialize bookmark structure - all commands need this
|
||||||
|
if self.ID not in self.env['commandBuffer']['bookMarks']:
|
||||||
|
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
||||||
|
|
||||||
|
def shutdown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def getDescription(self):
|
||||||
|
if self.action == 'read':
|
||||||
|
return _('read Bookmark {0}').format(self.ID)
|
||||||
|
elif self.action == 'set':
|
||||||
|
return _('set Bookmark {0}').format(self.ID)
|
||||||
|
elif self.action == 'clear':
|
||||||
|
return _('remove Bookmark {0}').format(self.ID)
|
||||||
|
return f'{self.action} Bookmark {self.ID}'
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
if self.action == 'read':
|
||||||
|
self._read_bookmark()
|
||||||
|
elif self.action == 'set':
|
||||||
|
self._set_bookmark()
|
||||||
|
elif self.action == 'clear':
|
||||||
|
self._clear_bookmark()
|
||||||
|
|
||||||
|
def _read_bookmark(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 currApp not in self.env['commandBuffer']['bookMarks'][self.ID]:
|
||||||
|
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].get('1'):
|
||||||
|
self.env['runtime']['outputManager'].presentText('Bookmark for application {0} not set'.format(currApp), interrupt=True)
|
||||||
|
return
|
||||||
|
|
||||||
|
# Get bookmarked text
|
||||||
|
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 _set_bookmark(self):
|
||||||
|
if not self.env['commandBuffer']['Marks']['1']:
|
||||||
|
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
||||||
|
return
|
||||||
|
|
||||||
|
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
||||||
|
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
||||||
|
|
||||||
|
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
||||||
|
|
||||||
|
if self.env['commandBuffer']['Marks']['2']:
|
||||||
|
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
||||||
|
else:
|
||||||
|
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
||||||
|
|
||||||
|
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
||||||
|
|
||||||
|
# Clear marks after setting bookmark
|
||||||
|
self.env['commandBuffer']['Marks']['1'] = None
|
||||||
|
self.env['commandBuffer']['Marks']['2'] = None
|
||||||
|
|
||||||
|
def _clear_bookmark(self):
|
||||||
|
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
||||||
|
|
||||||
|
if self.ID in self.env['commandBuffer']['bookMarks'] and currApp in self.env['commandBuffer']['bookMarks'][self.ID]:
|
||||||
|
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)
|
||||||
|
else:
|
||||||
|
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} not set for application {1}').format(self.ID, currApp), interrupt=True)
|
||||||
|
|
||||||
|
def setCallback(self, callback):
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Factory function to create bookmark command instances
|
||||||
|
def create_bookmark_commands():
|
||||||
|
"""Create all bookmark command instances"""
|
||||||
|
commands = {}
|
||||||
|
|
||||||
|
# Create read bookmark commands (bookmark_1 through bookmark_10)
|
||||||
|
for i in range(1, 11):
|
||||||
|
commands[f'bookmark_{i}'] = lambda i=i: BookmarkCommand(i, 'read')
|
||||||
|
|
||||||
|
# Create set bookmark commands (set_bookmark_1 through set_bookmark_10)
|
||||||
|
for i in range(1, 11):
|
||||||
|
commands[f'set_bookmark_{i}'] = lambda i=i: BookmarkCommand(i, 'set')
|
||||||
|
|
||||||
|
# Create clear bookmark commands (clear_bookmark_1 through clear_bookmark_10)
|
||||||
|
for i in range(1, 11):
|
||||||
|
commands[f'clear_bookmark_{i}'] = lambda i=i: BookmarkCommand(i, 'clear')
|
||||||
|
|
||||||
|
return commands
|
||||||
|
|
||||||
|
# For backwards compatibility, provide individual command classes
|
||||||
|
# This allows the existing command loading system to work unchanged
|
||||||
|
|
||||||
|
def _make_command_class(bookmark_id, action):
|
||||||
|
"""Create a command class for a specific bookmark and action"""
|
||||||
|
class command(BookmarkCommand):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__(bookmark_id, action)
|
||||||
|
return command
|
||||||
|
|
||||||
|
# Generate individual command classes for each bookmark operation
|
||||||
|
# These will be used by the existing command loading system
|
||||||
|
|
||||||
|
# Read bookmarks (bookmark_1.py style)
|
||||||
|
for i in range(1, 11):
|
||||||
|
globals()[f'bookmark_{i}_command'] = _make_command_class(i, 'read')
|
||||||
|
|
||||||
|
# Set bookmarks (set_bookmark_1.py style)
|
||||||
|
for i in range(1, 11):
|
||||||
|
globals()[f'set_bookmark_{i}_command'] = _make_command_class(i, 'set')
|
||||||
|
|
||||||
|
# Clear bookmarks (clear_bookmark_1.py style)
|
||||||
|
for i in range(1, 11):
|
||||||
|
globals()[f'clear_bookmark_{i}_command'] = _make_command_class(i, 'clear')
|
||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '1'
|
super().__init__(1, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '10'
|
super().__init__(10, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '2'
|
super().__init__(2, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '3'
|
super().__init__(3, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '4'
|
super().__init__(4, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '5'
|
super().__init__(5, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '6'
|
super().__init__(6, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '7'
|
super().__init__(7, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '8'
|
super().__init__(8, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,23 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '9'
|
super().__init__(9, 'clear')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,35 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
initialized = False
|
import os
|
||||||
try:
|
import importlib.util
|
||||||
import alsaaudio
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
initialized = True
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
except:
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
pass
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
|
class command(AdjustmentCommand):
|
||||||
class command():
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('alsa', 'volume', 'dec')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,29 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
import math
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
class command():
|
class command(AdjustmentCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('sound', 'volume', 'dec')
|
||||||
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
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,25 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
import math
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
class command():
|
class command(AdjustmentCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('speech', 'pitch', 'dec')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,26 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
import math
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
class command():
|
class command(AdjustmentCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('speech', 'rate', 'dec')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,27 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
import math
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
class command():
|
class command(AdjustmentCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('speech', 'volume', 'dec')
|
||||||
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
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,35 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
initialized = False
|
import os
|
||||||
try:
|
import importlib.util
|
||||||
import alsaaudio
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
initialized = True
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
except:
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
pass
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
|
class command(AdjustmentCommand):
|
||||||
class command():
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('alsa', 'volume', 'inc')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,28 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
import math
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
class command():
|
class command(AdjustmentCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('sound', 'volume', 'inc')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,26 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
import math
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
class command():
|
class command(AdjustmentCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('speech', 'pitch', 'inc')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,26 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
import math
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
class command():
|
class command(AdjustmentCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('speech', 'rate', 'inc')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,26 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
import math
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'adjustment_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("adjustment_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
AdjustmentCommand = _module.AdjustmentCommand
|
||||||
|
|
||||||
class command():
|
class command(AdjustmentCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('speech', 'volume', 'inc')
|
||||||
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
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '1'
|
super().__init__(1, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '10'
|
super().__init__(10, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '2'
|
super().__init__(2, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '3'
|
super().__init__(3, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '4'
|
super().__init__(4, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '5'
|
super().__init__(5, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '6'
|
super().__init__(6, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '7'
|
super().__init__(7, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '8'
|
super().__init__(8, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,32 +4,14 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import importlib.util
|
||||||
|
_base_path = os.path.join(os.path.dirname(__file__), 'bookmark_base.py')
|
||||||
|
_spec = importlib.util.spec_from_file_location("bookmark_base", _base_path)
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
BookmarkCommand = _module.BookmarkCommand
|
||||||
|
|
||||||
class command():
|
class command(BookmarkCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ID = '9'
|
super().__init__(9, 'set')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID] = {}
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('set Bookmark {0}').format(self.ID,)
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
if not self.env['commandBuffer']['Marks']['1']:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_("No mark found"), interrupt=True)
|
|
||||||
return
|
|
||||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp] = {}
|
|
||||||
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['1'] = self.env['commandBuffer']['Marks']['1'].copy()
|
|
||||||
if self.env['commandBuffer']['Marks']['2']:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = self.env['commandBuffer']['Marks']['2'].copy()
|
|
||||||
else:
|
|
||||||
self.env['commandBuffer']['bookMarks'][self.ID][currApp]['2'] = None
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('Bookmark {0} set for application {1}').format(self.ID, currApp), interrupt=True)
|
|
||||||
self.env['commandBuffer']['Marks']['1'] = None
|
|
||||||
self.env['commandBuffer']['Marks']['2'] = None
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,8 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
from fenrirscreenreader.commands.vmenu_navigation.vmenu_search_base import VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('a')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('a')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('b')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('b')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('c')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('c')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('d')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('d')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('e')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('e')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('f')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('f')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('g')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('g')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('h')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('h')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('i')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('i')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('j')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('j')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('k')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('k')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('l')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('l')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('m')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('m')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('n')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('n')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('o')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('o')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('p')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('p')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('q')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('q')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('r')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('r')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('s')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('s')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('t')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('t')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('u')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('u')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('v')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('v')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('w')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('a')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('x')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('x')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('y')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('y')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -4,21 +4,13 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
|
_spec = importlib.util.spec_from_file_location("vmenu_search_base", os.path.join(os.path.dirname(__file__), "vmenu_search_base.py"))
|
||||||
|
_module = importlib.util.module_from_spec(_spec)
|
||||||
|
_spec.loader.exec_module(_module)
|
||||||
|
VMenuSearchCommand = _module.VMenuSearchCommand
|
||||||
|
|
||||||
class command():
|
class command(VMenuSearchCommand):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
super().__init__('z')
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return _('search for an menu entry')
|
|
||||||
def run(self):
|
|
||||||
text = self.env['runtime']['vmenuManager'].searchEntry('z')
|
|
||||||
if text != '':
|
|
||||||
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
|
||||||
else:
|
|
||||||
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Fenrir TTY screen reader
|
||||||
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
|
class VMenuSearchCommand():
|
||||||
|
"""Base class for VMenu search commands"""
|
||||||
|
def __init__(self, search_char):
|
||||||
|
self.search_char = search_char.lower()
|
||||||
|
|
||||||
|
def initialize(self, environment):
|
||||||
|
self.env = environment
|
||||||
|
|
||||||
|
def shutdown(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def getDescription(self):
|
||||||
|
return _('search for an menu entry')
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
text = self.env['runtime']['vmenuManager'].searchEntry(self.search_char)
|
||||||
|
if text != '':
|
||||||
|
self.env['runtime']['outputManager'].presentText(text, interrupt=True)
|
||||||
|
else:
|
||||||
|
self.env['runtime']['outputManager'].presentText(_('not found'), soundIcon='ErrorScreen', interrupt=True)
|
||||||
|
|
||||||
|
def setCallback(self, callback):
|
||||||
|
pass
|
||||||
Reference in New Issue
Block a user