tdefine special hooks for install wizard - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit 94c9bf3655d682bb70853629fb9b2a6d51d3cb7a (DIR) parent 8b44dd2a9ef69439e415a5dd684b0e84aab6b163 (HTM) Author: ThomasV <thomasv@gitorious> Date: Fri, 30 Jan 2015 13:18:00 +0100 define special hooks for install wizard Diffstat: M lib/plugins.py | 3 ++- M plugins/trustedcoin.py | 16 +++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) --- (DIR) diff --git a/lib/plugins.py b/lib/plugins.py t@@ -40,12 +40,13 @@ def hook(func): def run_hook(name, *args): + SPECIAL_HOOKS = ['add_wallet_types', 'get_wizard_action'] results = [] f_list = hooks.get(name,[]) for p, f in f_list: if name == 'load_wallet': p.wallet = args[0] - if p.is_enabled(): + if name in SPECIAL_HOOKS or p.is_enabled(): try: r = f(*args) except Exception: (DIR) diff --git a/plugins/trustedcoin.py b/plugins/trustedcoin.py t@@ -344,15 +344,13 @@ class Plugin(BasePlugin): @hook def load_wallet(self, wallet): - self.wallet = wallet - if self.is_enabled(): - self.trustedcoin_button = StatusBarButton( QIcon(":icons/trustedcoin.png"), _("Network"), self.settings_dialog) - self.window.statusBar().addPermanentWidget(self.trustedcoin_button) - self.xpub = self.wallet.master_public_keys.get('x1/') - self.user_id = self.get_user_id()[1] - t = threading.Thread(target=self.request_billing_info) - t.setDaemon(True) - t.start() + self.trustedcoin_button = StatusBarButton( QIcon(":icons/trustedcoin.png"), _("Network"), self.settings_dialog) + self.window.statusBar().addPermanentWidget(self.trustedcoin_button) + self.xpub = self.wallet.master_public_keys.get('x1/') + self.user_id = self.get_user_id()[1] + t = threading.Thread(target=self.request_billing_info) + t.setDaemon(True) + t.start() @hook def close_wallet(self):