From 88f26387642f6ea1e7883f41868455ddc8581e7a Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Wed, 20 Feb 2008 20:24:08 +0000 Subject: [PATCH] fix CoreMethod --- deluge/ui/webui/webui_plugin/pages.py | 4 ++-- .../ui/webui/webui_plugin/webserver_common.py | 21 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/deluge/ui/webui/webui_plugin/pages.py b/deluge/ui/webui/webui_plugin/pages.py index 7e58ab71a..212258054 100644 --- a/deluge/ui/webui/webui_plugin/pages.py +++ b/deluge/ui/webui/webui_plugin/pages.py @@ -229,7 +229,7 @@ class torrent_queue_up: torrent_ids = [t.id for t in torrent_list] for torrent_id in torrent_ids: #async_proxy.get_core().call("queue_queue_up", None, torrent_id) - proxy.queue_queue_up(torrent_id) + async_proxy.queue_queue_up(None, torrent_id) do_redirect() class torrent_queue_down: @@ -241,7 +241,7 @@ class torrent_queue_down: torrent_ids = [t.id for t in torrent_list] for torrent_id in reversed(torrent_ids): #async_proxy.get_core().call("queue_queue_down", None, torrent_id) - proxy.queue_queue_down(torrent_id) + async_proxy.queue_queue_down(None, torrent_id) do_redirect() class torrent_files: diff --git a/deluge/ui/webui/webui_plugin/webserver_common.py b/deluge/ui/webui/webui_plugin/webserver_common.py index 9c9e3deb1..86e44caaa 100644 --- a/deluge/ui/webui/webui_plugin/webserver_common.py +++ b/deluge/ui/webui/webui_plugin/webserver_common.py @@ -99,8 +99,8 @@ CONFIG_DEFAULTS = { "auto_refresh":False, "auto_refresh_secs": 10, "template":"advanced", - "pwd_salt":"2540626806573060601127357001536142078273646936492343724296134859793541603059837926595027859394922651189016967573954758097008242073480355104215558310954", - "pwd_md5":"\xea\x8d\x90\x98^\x9f\xa9\xe2\x19l\x7f\x1a\xca\x82u%", + "pwd_salt":"2\xe8\xc7\xa6(n\x81_\x8f\xfc\xdf\x8b\xd1\x1e\xd5\x90", + "pwd_md5":".\xe8w\\+\xec\xdb\xf2id4F\xdb\rUc", "cache_templates":False, "use_https":False } @@ -142,24 +142,27 @@ class CoreMethod: """ def __init__(self, method_name): self.method_name = method_name - self.result = None - def __call__(self,*args,**kwargs): - client.get_core().call(self.method_name, self.callback ,*args, **kwargs) - return self.result - - def callback(self, result): - self.result = result + def __call__(self, callback, *args,**kwargs): + client.get_core().call(self.method_name, callback ,*args, **kwargs) class BlockingCoreMethod(CoreMethod): """ for syncProcy """ + def __init__(self, method_name): + self.method_name = method_name + self.result = None + def __call__(self,*args,**kwargs): client.get_core().call(self.method_name, self.callback ,*args, **kwargs) client.force_call(block=True) return self.result + def callback(self, result): + self.result = result + + class SyncProxy(object): """acts like the old synchonous proxy""" def __getattr__(self, method_name):