From e2eaa9abb4566d5ace1d1ca361ef39c1c411885b Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Thu, 31 Jan 2008 19:11:39 +0000 Subject: [PATCH] logout;more robust async --- .../ui/webui/webui_plugin/templates/advanced/part_stats.html | 2 ++ deluge/ui/webui/webui_plugin/templates/deluge/part_stats.html | 3 +++ deluge/ui/webui/webui_plugin/webserver_common.py | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html b/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html index 2bccc8bfe..0a11c0bf4 100644 --- a/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html +++ b/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html @@ -13,6 +13,8 @@ $else: $:render.part_button('POST', '/refresh/on', _('Enable'), 'tango/view-refresh.png') $#end +$:render.part_button('POST', '/logout', _('Logout'), 'tango/system-log-out.png') +
diff --git a/deluge/ui/webui/webui_plugin/templates/deluge/part_stats.html b/deluge/ui/webui/webui_plugin/templates/deluge/part_stats.html index 305a9ea25..314e7c2d4 100644 --- a/deluge/ui/webui/webui_plugin/templates/deluge/part_stats.html +++ b/deluge/ui/webui/webui_plugin/templates/deluge/part_stats.html @@ -12,6 +12,9 @@ $else: $_('Off')   $:render.part_button('POST', '/refresh/on', _('Enable'), 'tango/view-refresh.png') $#end + +$:render.part_button('POST', '/logout', _('Logout'), 'tango/system-log-out.png') +
diff --git a/deluge/ui/webui/webui_plugin/webserver_common.py b/deluge/ui/webui/webui_plugin/webserver_common.py index aa12ca6fb..ab332a119 100644 --- a/deluge/ui/webui/webui_plugin/webserver_common.py +++ b/deluge/ui/webui/webui_plugin/webserver_common.py @@ -118,12 +118,14 @@ class SyncProxyFunction: self.client = client def __call__(self,*args,**kwargs): - sync_result = [] func = getattr(self.client,self.func_name) if self.has_callback(func): + sync_result = [] func(sync_result.append,*args, **kwargs) self.client.force_call(block=True) + if not sync_result: + return None return sync_result[0] else: ws.log.debug('no-cb: %s' % self.func_name)