electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 48ad7c36a8357e5664085cd5d282fd6dfede2bc8
parent d40c12c9490f59be6bea15f46d9ca0072f936ac3
Author: ThomasV <thomasv@gitorious>
Date:   Sun, 24 May 2015 10:06:53 +0200

show plugin dependencies

Diffstat:
Mgui/qt/main_window.py | 5++++-
Mlib/plugins.py | 4++--
Mplugins/__init__.py | 35+++++++++++++++++------------------
3 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -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) diff --git a/lib/plugins.py b/lib/plugins.py @@ -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() diff --git a/plugins/__init__.py b/plugins/__init__.py @@ -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',