URI: 
       tRemove some unused hook infrastructure - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit d63e754c6737a4ac4b43236eeb6bde48b3737fbd
   DIR parent 2f58d419dc8307c62478f6a171eafafb23d9127e
  HTML Author: Neil Booth <kyuupichan@gmail.com>
       Date:   Fri,  1 Jan 2016 19:15:01 +0900
       
       Remove some unused hook infrastructure
       
       Diffstat:
         M electrum                            |       4 +---
         M lib/plugins.py                      |       8 +-------
         M plugins/ledger/cmdline.py           |       7 +------
       
       3 files changed, 3 insertions(+), 16 deletions(-)
       ---
   DIR diff --git a/electrum b/electrum
       t@@ -79,7 +79,7 @@ if is_bundle or is_local or is_android:
        from electrum import util
        from electrum import SimpleConfig, Network, Wallet, WalletStorage
        from electrum.util import print_msg, print_error, print_stderr, json_encode, json_decode, set_verbosity, InvalidPassword
       -from electrum.plugins import Plugins, run_hook, always_hook
       +from electrum.plugins import Plugins, run_hook
        from electrum.commands import get_parser, known_commands, Commands, config_variables
        from electrum.daemon import Daemon, get_daemon
        
       t@@ -242,8 +242,6 @@ def run_offline_command(config, config_options):
                    sys.exit(1)
            if cmd.requires_network:
                print_stderr("Warning: running command offline")
       -    # notify plugins
       -    always_hook('cmdline_load_wallet', wallet)
            # arguments passed to function
            args = map(lambda x: config.get(x), cmd.params)
            # decode json arguments
   DIR diff --git a/lib/plugins.py b/lib/plugins.py
       t@@ -145,16 +145,10 @@ def hook(func):
            return func
        
        def run_hook(name, *args):
       -    return _run_hook(name, False, *args)
       -
       -def always_hook(name, *args):
       -    return _run_hook(name, True, *args)
       -
       -def _run_hook(name, always, *args):
            results = []
            f_list = hooks.get(name, [])
            for p, f in f_list:
       -        if always or p.is_enabled():
       +        if p.is_enabled():
                    try:
                        r = f(*args)
                    except Exception:
   DIR diff --git a/plugins/ledger/cmdline.py b/plugins/ledger/cmdline.py
       t@@ -1,6 +1,5 @@
        from legder import LedgerPlugin
        from electrum.util import print_msg
       -from electrum.plugins import hook
        
        class BTChipCmdLineHandler:
            def stop(self):
       t@@ -18,8 +17,4 @@ class BTChipCmdLineHandler:
                return response
        
        class Plugin(LedgerPlugin):
       -    @hook
       -    def cmdline_load_wallet(self, wallet):
       -        wallet.plugin = self
       -        if self.handler is None:
       -            self.handler = BTChipCmdLineHandler()
       +    handler = BTChipCmdLineHandler()