Delete src/pyxtend/pyxtend_core.py

This commit is contained in:
Lerking
2024-03-06 12:26:51 +01:00
committed by GitHub
parent 69e296f34e
commit 08833185eb
-31
View File
@@ -1,31 +0,0 @@
from logging import Logger
from usecase import PluginUseCase
from util import LogUtil
class PyXtendEngine:
_logger: Logger
def __init__(self, **args) -> None:
self._logger = LogUtil.create(args['options']['log_level'])
self.use_case = PluginUseCase(args['options'])
def start(self) -> None:
self.__reload_plugins()
self.__invoke_on_plugins('Q')
def __reload_plugins(self) -> None:
"""Reset the list of all plugins and initiate the walk over the main
provided plugin package to load all available plugins
"""
self.use_case.discover_plugins(True)
def __invoke_on_plugins(self, command: chr):
"""Apply all of the plugins on the argument supplied to this function
"""
for module in self.use_case.modules:
plugin = self.use_case.register_plugin(module, self._logger)
delegate = self.use_case.hook_plugin(plugin)
device = delegate(command=command)
self._logger.info(f'Loaded device: {device}')