1
0

Remove constructor method of plugins

Clean up wallet class loading.
This commit is contained in:
Neil Booth
2016-01-01 23:39:19 +09:00
parent cf4ee487cd
commit 1d07960290
6 changed files with 28 additions and 35 deletions

View File

@@ -118,10 +118,13 @@ class Plugins(DaemonThread):
return result
def register_plugin_wallet(self, name, gui_good, details):
def dynamic_constructor(storage):
return self.wallet_plugin_loader(name).wallet_class(storage)
if details[0] == 'hardware':
self.hw_wallets[name] = (gui_good, details)
register = details + (lambda: self.wallet_plugin_loader(name),)
wallet.wallet_types.append(register)
self.print_error("registering wallet %s: %s" %(name, details))
wallet.wallet_types.append(details + (dynamic_constructor,))
def wallet_plugin_loader(self, name):
if not name in self.plugins: