1
0

plugin commands: load the plugin in func_wrapper

This commit is contained in:
ThomasV
2025-03-16 12:25:59 +01:00
parent 51890fd0b5
commit d2fa404e06
2 changed files with 8 additions and 5 deletions

View File

@@ -7,16 +7,14 @@ if TYPE_CHECKING:
plugin_name = "labels"
@plugin_command('w', plugin_name)
async def push(self: 'Commands', wallet=None) -> int:
async def push(self: 'Commands', plugin: 'LabelsPlugin' = None, wallet=None) -> int:
""" push labels to server """
plugin: 'LabelsPlugin' = self.daemon._plugins.get_plugin(plugin_name)
return await plugin.push_thread(wallet)
@plugin_command('w', plugin_name)
async def pull(self: 'Commands', wallet=None) -> int:
async def pull(self: 'Commands', plugin: 'LabelsPlugin' = None, wallet=None) -> int:
""" pull labels from server """
assert wallet is not None
plugin: 'LabelsPlugin' = self.daemon._plugins.get_plugin(plugin_name)
return await plugin.pull_thread(wallet, force=False)