Commit 2 of 2, code refactor and cleanup.
This commit is contained in:
@ -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')
|
||||
|
Reference in New Issue
Block a user