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: else:
w = None w = None
cb.clicked.connect(mk_toggle(cb, name, w)) 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: except Exception:
print_msg("Error: cannot display plugin", name) print_msg("Error: cannot display plugin", name)
traceback.print_exc(file=sys.stdout) traceback.print_exc(file=sys.stdout)

View File

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

View File

@ -22,16 +22,15 @@ descriptions = [
{ {
'name': 'audio_modem', 'name': 'audio_modem',
'fullname': _('Audio MODEM'), 'fullname': _('Audio MODEM'),
'description': ('Provides support for air-gapped transaction signing.\n\n' 'description': _('Provides support for air-gapped transaction signing.'),
'Requires http://github.com/romanz/amodem/'), 'requires': [('amodem', 'http://github.com/romanz/amodem/')],
'requires': ['amodem'],
'available_for': ['qt'], 'available_for': ['qt'],
}, },
{ {
'name': 'btchipwallet', 'name': 'btchipwallet',
'fullname': _('BTChip Wallet'), 'fullname': _('BTChip Wallet'),
'description': _('Provides support for BTChip hardware wallet') + '\n\n' + _('Requires github.com/btchip/btchip-python'), 'description': _('Provides support for BTChip hardware wallet'),
'requires': ['btchip'], 'requires': [('btchip', 'github.com/btchip/btchip-python')],
'requires_wallet_type': ['btchip'], 'requires_wallet_type': ['btchip'],
'registers_wallet_type': True, 'registers_wallet_type': True,
'available_for': ['qt'], 'available_for': ['qt'],
@ -43,14 +42,14 @@ descriptions = [
_("This plugin facilitates the use of multi-signatures wallets."), _("This plugin facilitates the use of multi-signatures wallets."),
_("It sends and receives partially signed transactions from/to your cosigner wallet."), _("It sends and receives partially signed transactions from/to your cosigner wallet."),
_("Transactions are encrypted and stored on a remote server.") _("Transactions are encrypted and stored on a remote server.")
]), ]),
'requires_wallet_type': ['2of2', '2of3'], 'requires_wallet_type': ['2of2', '2of3'],
'available_for': ['qt'], 'available_for': ['qt'],
}, },
{ {
'name': 'exchange_rate', 'name': 'exchange_rate',
'fullname': _("Exchange rates"), 'fullname': _("Exchange rates"),
'description': """exchange rates, retrieved from blockchain.info, CoinDesk, or Coinbase""", 'description': _("Exchange rates and currency conversion tools."),
'available_for': ['qt'], 'available_for': ['qt'],
}, },
{ {
@ -62,35 +61,35 @@ descriptions = [
{ {
'name': 'labels', 'name': 'labels',
'fullname': _('LabelSync'), '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'] 'available_for': ['qt']
}, },
{ {
'name': 'openalias', 'name': 'openalias',
'fullname': 'OpenAlias', 'fullname': 'OpenAlias',
'description': 'Allow for payments to OpenAlias addresses.\nRequires dnspython', 'description': _('Allow for payments to OpenAlias addresses.'),
'requires': ['dns'], 'requires': [('dns', 'dnspython')],
'available_for': ['qt'] 'available_for': ['qt']
}, },
{ {
'name': 'plot', 'name': 'plot',
'fullname': 'Plot History', 'fullname': 'Plot History',
'description': '\n'.join([ 'description': _("Ability to plot transaction history in graphical mode."),
_("Ability to plot transaction history in graphical mode."), 'requires': [('matplotlib', 'matplotlib')],
_("Warning: Requires matplotlib library.")
]),
'requires': ['matplotlib'],
'available_for': ['qt'], 'available_for': ['qt'],
}, },
{ {
'name':'trezor', 'name':'trezor',
'fullname': 'Trezor Wallet', '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'], 'available_for': ['qt'],
'requires': ['trezorlib'], 'requires': [('trezorlib','github.com/trezor/python-trezor')],
'requires_wallet_type': ['trezor'], 'requires_wallet_type': ['trezor'],
'registers_wallet_type': True, 'registers_wallet_type': True,
'available_for': ['qt', 'cmdline'] 'available_for': ['qt', 'cmdline'],
}, },
{ {
'name': 'trustedcoin', 'name': 'trustedcoin',