show plugin dependencies

This commit is contained in:
ThomasV 2015-05-24 10:06:53 +02:00
parent d40c12c949
commit 48ad7c36a8
3 changed files with 23 additions and 21 deletions

View File

@ -2715,7 +2715,10 @@ class ElectrumWindow(QMainWindow):
else:
w = None
cb.clicked.connect(mk_toggle(cb, name, w))
grid.addWidget(HelpButton(descr['description']), i, 2)
msg = descr['description']
if descr.get('requires'):
msg += '\n\n' + _('Requires') + ':\n' + '\n'.join(map(lambda x: x[1], descr.get('requires')))
grid.addWidget(HelpButton(msg), i, 2)
except Exception:
print_msg("Error: cannot display plugin", name)
traceback.print_exc(file=sys.stdout)

View File

@ -37,7 +37,7 @@ def is_available(name, w):
else:
return False
deps = d.get('requires', [])
for dep in deps:
for dep, s in deps:
try:
__import__(dep)
except ImportError:
@ -84,7 +84,7 @@ def init_plugins(config, is_local, gui_name):
p = loader(name)
plugins[name] = p.Plugin(config, name)
except Exception:
print_msg(_("Error: cannot initialize plugin"), p)
print_msg(_("Error: cannot initialize plugin"), name)
traceback.print_exc(file=sys.stdout)
hook_names = set()

View File

@ -22,16 +22,15 @@ descriptions = [
{
'name': 'audio_modem',
'fullname': _('Audio MODEM'),
'description': ('Provides support for air-gapped transaction signing.\n\n'
'Requires http://github.com/romanz/amodem/'),
'requires': ['amodem'],
'description': _('Provides support for air-gapped transaction signing.'),
'requires': [('amodem', 'http://github.com/romanz/amodem/')],
'available_for': ['qt'],
},
{
'name': 'btchipwallet',
'fullname': _('BTChip Wallet'),
'description': _('Provides support for BTChip hardware wallet') + '\n\n' + _('Requires github.com/btchip/btchip-python'),
'requires': ['btchip'],
'description': _('Provides support for BTChip hardware wallet'),
'requires': [('btchip', 'github.com/btchip/btchip-python')],
'requires_wallet_type': ['btchip'],
'registers_wallet_type': True,
'available_for': ['qt'],
@ -43,14 +42,14 @@ descriptions = [
_("This plugin facilitates the use of multi-signatures wallets."),
_("It sends and receives partially signed transactions from/to your cosigner wallet."),
_("Transactions are encrypted and stored on a remote server.")
]),
]),
'requires_wallet_type': ['2of2', '2of3'],
'available_for': ['qt'],
},
{
'name': 'exchange_rate',
'fullname': _("Exchange rates"),
'description': """exchange rates, retrieved from blockchain.info, CoinDesk, or Coinbase""",
'description': _("Exchange rates and currency conversion tools."),
'available_for': ['qt'],
},
{
@ -62,35 +61,35 @@ descriptions = [
{
'name': 'labels',
'fullname': _('LabelSync'),
'description': '%s\n\n%s' % (_("The new and improved LabelSync plugin. This can sync your labels across multiple Electrum installs by using a remote database to save your data. Labels, transactions ids and addresses are encrypted before they are sent to the remote server."), _("The label sync's server software is open-source as well and can be found on github.com/maran/electrum-sync-server")),
'description': '\n'.join([
_("The new and improved LabelSync plugin. This can sync your labels across multiple Electrum installs by using a remote database to save your data. Labels, transactions ids and addresses are encrypted before they are sent to the remote server."),
_("The label sync's server software is open-source as well and can be found on github.com/maran/electrum-sync-server")
]),
'available_for': ['qt']
},
{
'name': 'openalias',
'fullname': 'OpenAlias',
'description': 'Allow for payments to OpenAlias addresses.\nRequires dnspython',
'requires': ['dns'],
'description': _('Allow for payments to OpenAlias addresses.'),
'requires': [('dns', 'dnspython')],
'available_for': ['qt']
},
{
'name': 'plot',
'fullname': 'Plot History',
'description': '\n'.join([
_("Ability to plot transaction history in graphical mode."),
_("Warning: Requires matplotlib library.")
]),
'requires': ['matplotlib'],
'description': _("Ability to plot transaction history in graphical mode."),
'requires': [('matplotlib', 'matplotlib')],
'available_for': ['qt'],
},
{
'name':'trezor',
'fullname': 'Trezor Wallet',
'description': 'Provides support for Trezor hardware wallet\n\nRequires github.com/trezor/python-trezor',
'description': _('Provides support for Trezor hardware wallet'),
'available_for': ['qt'],
'requires': ['trezorlib'],
'requires': [('trezorlib','github.com/trezor/python-trezor')],
'requires_wallet_type': ['trezor'],
'registers_wallet_type': True,
'available_for': ['qt', 'cmdline']
'available_for': ['qt', 'cmdline'],
},
{
'name': 'trustedcoin',