1
0

restrict plugins to the gui

This commit is contained in:
thomasv
2013-03-03 16:01:47 +01:00
parent 7e74fcc935
commit 190f733de2
5 changed files with 65 additions and 79 deletions

View File

@@ -106,10 +106,6 @@ class Wallet:
except:
print_msg("Warning: Cannot deserialize transactions. skipping")
# plugins
self.plugins = []
self.plugin_hooks = {}
# not saved
self.prevout_values = {} # my own transaction outputs
self.spent_outputs = []
@@ -134,32 +130,6 @@ class Wallet:
self.update_tx_outputs(tx_hash)
# plugins
def set_hook(self, name, callback):
h = self.plugin_hooks.get(name, [])
h.append(callback)
self.plugin_hooks[name] = h
def unset_hook(self, name, callback):
h = self.plugin_hooks.get(name,[])
if callback in h: h.remove(callback)
self.plugin_hooks[name] = h
def run_hook(self, name, args):
for cb in self.plugin_hooks.get(name,[]):
apply(cb, args)
def init_plugins(self, plugins):
self.plugins = plugins
for p in plugins:
try:
p.init(self)
except:
import traceback
print_msg("Error:cannot initialize plugin",p)
traceback.print_exc(file=sys.stdout)
def set_up_to_date(self,b):
with self.lock: self.up_to_date = b