feat(spotlight): add plugin system with core engine and examples
- Plugin API (plugin.py, context.py, result.py) - Core engine (search.py, manager.py, registry.py, loader.py) - Built-in plugins: app, calculator, clipboard, emoji, power_menu, query, wallpapers - Spotlight docs and example plugins - Spotlight CSS styling
This commit is contained in:
24 files changed
+3130
-20
No files matched your search
@@ -0,0 +1,24 @@
|
||||
"""
|
||||
Modus Launcher plugins package.
|
||||
|
||||
Built-in plugins are auto-discovered via pkgutil.
|
||||
Each plugin module exposes a PLUGIN variable pointing to its class.
|
||||
"""
|
||||
|
||||
import importlib
|
||||
import pkgutil
|
||||
|
||||
__all__ = []
|
||||
|
||||
for module_info in pkgutil.iter_modules(__path__):
|
||||
module_name = module_info.name
|
||||
if module_name.startswith("_"):
|
||||
continue
|
||||
try:
|
||||
module = importlib.import_module(f"{__name__}.{module_name}")
|
||||
plugin_class = getattr(module, "PLUGIN", None)
|
||||
if plugin_class is not None:
|
||||
globals()[module_name] = plugin_class
|
||||
__all__.append(module_name)
|
||||
except Exception:
|
||||
pass
|
||||
Reference in new issue
Block a user