1
0

call load_wallet and close_wallet for each plugin

This commit is contained in:
ThomasV
2015-01-26 20:42:32 +01:00
parent 9d40fb2ea8
commit dda4a0fcb3
3 changed files with 24 additions and 12 deletions

View File

@@ -45,16 +45,17 @@ def run_hook(name, *args):
for p, f in f_list:
if name == 'load_wallet':
p.wallet = args[0]
if not p.is_enabled():
continue
try:
r = f(*args)
except Exception:
print_error("Plugin error")
traceback.print_exc(file=sys.stdout)
r = False
if r:
results.append(r)
if p.is_enabled():
try:
r = f(*args)
except Exception:
print_error("Plugin error")
traceback.print_exc(file=sys.stdout)
r = False
if r:
results.append(r)
if name == 'close_wallet':
p.wallet = None
if results:
assert len(results) == 1, results
@@ -92,8 +93,12 @@ class BasePlugin:
def init_qt(self, gui): pass
@hook
def load_wallet(self, wallet): pass
@hook
def close_wallet(self): pass
#def init(self): pass
def close(self): pass