1
0

move plugin commands to init file of plugin

This commit is contained in:
f321x
2025-03-17 17:29:38 +01:00
parent e7907d31cc
commit e74029c880
4 changed files with 29 additions and 31 deletions

View File

@@ -1,4 +1,11 @@
from electrum.i18n import _
from electrum.commands import plugin_command
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .labels import LabelsPlugin
from electrum.commands import Commands
fullname = _('LabelSync')
description = ' '.join([
@@ -7,3 +14,15 @@ description = ' '.join([
])
available_for = ['qt', 'qml', 'cmdline']
plugin_name = "labels"
@plugin_command('w', plugin_name)
async def push(self: 'Commands', plugin: 'LabelsPlugin' = None, wallet=None) -> int:
""" push labels to server """
return await plugin.push_thread(wallet)
@plugin_command('w', plugin_name)
async def pull(self: 'Commands', plugin: 'LabelsPlugin' = None, wallet=None, force=False) -> int:
""" pull labels from server """
return await plugin.pull_thread(wallet, force=force)

View File

@@ -1,20 +0,0 @@
from electrum.commands import plugin_command
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .labels import LabelsPlugin
from electrum.commands import Commands
plugin_name = "labels"
@plugin_command('w', plugin_name)
async def push(self: 'Commands', plugin: 'LabelsPlugin' = None, wallet=None) -> int:
""" push labels to server """
return await plugin.push_thread(wallet)
@plugin_command('w', plugin_name)
async def pull(self: 'Commands', plugin: 'LabelsPlugin' = None, wallet=None, force=False) -> int:
""" pull labels from server """
return await plugin.pull_thread(wallet, force=force)