✨ feat(launcher, plugin_manager): add lazy loading support for plugins with trigger mapping
This commit is contained in:
4 files changed
+126
-1277
No files matched your search
@@ -58,8 +58,8 @@ class CalculatorPlugin(PluginBase):
|
||||
self._cache_cleanup_interval = 300 # 5 minutes
|
||||
|
||||
def initialize(self):
|
||||
"""Initialize the files plugin."""
|
||||
self.set_triggers(["="])
|
||||
"""Initialize the calculator plugin."""
|
||||
self.set_triggers(["=", "calc"])
|
||||
|
||||
def _cleanup_cache(self):
|
||||
"""Clean up old cache entries."""
|
||||
@@ -95,7 +95,7 @@ class CalculatorPlugin(PluginBase):
|
||||
self._conversion_cache[cache_key] = result
|
||||
subtitle = f"{value} {from_unit} = {result:.6g} {to_unit}"
|
||||
|
||||
|
||||
|
||||
|
||||
return [
|
||||
Result(
|
||||
|
||||
Reference in new issue
Block a user