1
0

lazy plugin constructor

This commit is contained in:
ThomasV
2015-05-24 20:37:05 +02:00
parent 71046371ec
commit 778297697a
6 changed files with 25 additions and 19 deletions

View File

@@ -32,7 +32,7 @@ descriptions = [
'description': _('Provides support for BTChip hardware wallet'),
'requires': [('btchip', 'github.com/btchip/btchip-python')],
'requires_wallet_type': ['btchip'],
'registers_wallet_type': True,
'registers_wallet_type': ('hardware', 'btchip', _("BTChip wallet")),
'available_for': ['qt'],
},
{
@@ -88,7 +88,7 @@ descriptions = [
'available_for': ['qt'],
'requires': [('trezorlib','github.com/trezor/python-trezor')],
'requires_wallet_type': ['trezor'],
'registers_wallet_type': True,
'registers_wallet_type': ('hardware', 'trezor', _("Trezor wallet")),
'available_for': ['qt', 'cmdline'],
},
{
@@ -100,7 +100,7 @@ descriptions = [
" <a href=\"https://api.trustedcoin.com/#/electrum-help\">https://api.trustedcoin.com/#/electrum-help</a>"
]),
'requires_wallet_type': ['2fa'],
'registers_wallet_type': True,
'registers_wallet_type': ('twofactor', '2fa', _("Wallet with two-factor authentication")),
'available_for': ['qt', 'cmdline'],
},
{

View File

@@ -40,8 +40,8 @@ class Plugin(BasePlugin):
self._is_available = self._init()
self.wallet = None
def get_wallet_type(self):
return ('hardware', 'btchip', _("BTChip wallet"), BTChipWallet)
def constructor(self, s):
return BTChipWallet(s)
def _init(self):
return BTCHIP

View File

@@ -47,8 +47,8 @@ class Plugin(BasePlugin):
self._requires_settings = True
self.wallet = None
def get_wallet_type(self):
return ('hardware', 'trezor', _("Trezor wallet"), TrezorWallet)
def constructor(self, s):
return TrezorWallet(s)
def _init(self):
return TREZOR

View File

@@ -214,8 +214,8 @@ class Plugin(BasePlugin):
self.billing_info = None
self.is_billing = False
def get_wallet_type(self):
return ('twofactor', '2fa', _("Wallet with two-factor authentication"), Wallet_2fa)
def constructor(self, s):
return Wallet_2fa(s)
def is_available(self):
if not self.wallet: