Commit 2 of 2, code refactor and cleanup.

This commit is contained in:
Storm Dragon
2025-06-08 14:26:24 -04:00
parent ddc1b43304
commit 5cc719a6f3
69 changed files with 827 additions and 1489 deletions

View File

@ -4,21 +4,8 @@
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.commands.vmenu_navigation.vmenu_search_base import VMenuSearchCommand
class command():
class command(VMenuSearchCommand):
def __init__(self):
pass
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
super().__init__('a')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('b')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('c')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('d')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('e')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('f')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('g')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('h')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('i')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('j')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('k')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('l')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('m')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('n')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('o')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('p')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('q')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('r')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('s')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('t')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('u')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('v')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('w')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('x')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('y')

View File

@ -4,21 +4,13 @@
# Fenrir TTY screen reader
# 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):
pass
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
super().__init__('z')

View File

@ -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