# HG changeset patch # User Goffi # Date 1309307865 -7200 # Node ID fad0e51cf5655d684f2b976dc4b5e8043f0d7e01 # Parent c3fb3292f5820225930518c59d326e1b62deed85 on failure, Libervia now wait 5 s before trying again to call the serveur + only room name is now shown in tabs diff -r c3fb3292f582 -r fad0e51cf565 libervia.py --- a/libervia.py Wed Jun 29 02:08:43 2011 +0200 +++ b/libervia.py Wed Jun 29 02:37:45 2011 +0200 @@ -23,6 +23,7 @@ from pyjamas.ui.RootPanel import RootPanel from pyjamas.ui.HTML import HTML from pyjamas.ui.KeyboardListener import KEY_ESCAPE +from pyjamas.Timer import Timer from pyjamas import Window, DOM from pyjamas.JSONService import JSONProxy from browser_side.register import RegisterBox @@ -89,8 +90,10 @@ #we now try to reconnect if isinstance(errobj['message'],dict) and errobj['message']['faultCode']==0: Window.alert('You are not allowed to connect to server') - else: - self.host.bridge_signals.call('getSignals', self.host._getSignalsCB) + else: + def _timerCb(): + self.host.bridge_signals.call('getSignals', self.host._getSignalsCB) + Timer(notify=_timerCb).schedule(5000) #we wait 5 s and try again class MicroblogEntry(): def __init__(self, data): @@ -308,7 +311,7 @@ if room_id.startswith('sat_tarot_'): #XXX: it's not really beautiful, but it works :) self.addTab(chat_panel, "Tarot") else: - self.addTab(chat_panel, str(_target)) + self.addTab(chat_panel, _target.node) chat_panel.setPresents(room_nicks) chat_panel.historyPrint()