remove unnecessary stuff

This commit is contained in:
2022-08-28 08:45:23 +02:00
parent 32028a54b9
commit 23cdc14b3b
3 changed files with 0 additions and 41 deletions

View File

@@ -1,25 +1 @@
from inspect import isclass
from pkgutil import iter_modules
from pathlib import Path
from importlib import import_module
from src.pluginbase import PluginBase
# iterate through the modules in the current package
from src.pluginregistry import PluginRegistry
if False:
package_dir = Path(__file__).resolve().parent
for (_, module_name, _) in iter_modules([str(package_dir)]):
# import the module and iterate through its attributes
module = import_module(f"{__name__}.{module_name}")
print("module: %s" % module)
for attribute_name in dir(module):
if attribute_name == "PluginBase":
continue
attribute = getattr(module, attribute_name)
if isclass(attribute) and issubclass(attribute, PluginBase):
globals()[attribute_name] = attribute
PluginRegistry.register_plugin(attribute_name, attribute)
print("%s -> %s :: %s in %s" % (attribute_name, attribute, module_name, module))