logout;more robust async
This commit is contained in:
parent
a23ff6cbca
commit
e2eaa9abb4
|
@ -13,6 +13,8 @@ $else:
|
||||||
$:render.part_button('POST', '/refresh/on', _('Enable'), 'tango/view-refresh.png')
|
$:render.part_button('POST', '/refresh/on', _('Enable'), 'tango/view-refresh.png')
|
||||||
$#end
|
$#end
|
||||||
|
|
||||||
|
$:render.part_button('POST', '/logout', _('Logout'), 'tango/system-log-out.png')
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel" id='stats_panel'>
|
<div class="panel" id='stats_panel'>
|
||||||
|
|
|
@ -12,6 +12,9 @@ $else:
|
||||||
$_('Off')
|
$_('Off')
|
||||||
$:render.part_button('POST', '/refresh/on', _('Enable'), 'tango/view-refresh.png')
|
$:render.part_button('POST', '/refresh/on', _('Enable'), 'tango/view-refresh.png')
|
||||||
$#end
|
$#end
|
||||||
|
|
||||||
|
$:render.part_button('POST', '/logout', _('Logout'), 'tango/system-log-out.png')
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel" id='stats_panel'>
|
<div class="panel" id='stats_panel'>
|
||||||
|
|
|
@ -118,12 +118,14 @@ class SyncProxyFunction:
|
||||||
self.client = client
|
self.client = client
|
||||||
|
|
||||||
def __call__(self,*args,**kwargs):
|
def __call__(self,*args,**kwargs):
|
||||||
sync_result = []
|
|
||||||
func = getattr(self.client,self.func_name)
|
func = getattr(self.client,self.func_name)
|
||||||
|
|
||||||
if self.has_callback(func):
|
if self.has_callback(func):
|
||||||
|
sync_result = []
|
||||||
func(sync_result.append,*args, **kwargs)
|
func(sync_result.append,*args, **kwargs)
|
||||||
self.client.force_call(block=True)
|
self.client.force_call(block=True)
|
||||||
|
if not sync_result:
|
||||||
|
return None
|
||||||
return sync_result[0]
|
return sync_result[0]
|
||||||
else:
|
else:
|
||||||
ws.log.debug('no-cb: %s' % self.func_name)
|
ws.log.debug('no-cb: %s' % self.func_name)
|
||||||
|
|
Loading…
Reference in New Issue