comparison libervia.py @ 274:886b47896f3c

browser_side: better PEP8 compliance
author souliane <souliane@mailoo.org>
date Thu, 21 Nov 2013 16:05:14 +0100
parents 9eb9c7d41bdc
children a763b2ac5d41
comparison
equal deleted inserted replaced
273:11718798ab8a 274:886b47896f3c
134 134
135 def onRemoteResponse(self, response, request_info): 135 def onRemoteResponse(self, response, request_info):
136 self.retry_delay = self.RETRY_BASE_DELAY 136 self.retry_delay = self.RETRY_BASE_DELAY
137 LiberviaJsonProxy.onRemoteResponse(self, response, request_info) 137 LiberviaJsonProxy.onRemoteResponse(self, response, request_info)
138 138
139
140 def onRemoteError(self, code, errobj, request_info): 139 def onRemoteError(self, code, errobj, request_info):
141 if errobj['message'] == 'Empty Response': 140 if errobj['message'] == 'Empty Response':
142 Window.getLocation().reload() # XXX: reset page in case of session ended. 141 Window.getLocation().reload() # XXX: reset page in case of session ended.
143 # FIXME: Should be done more properly without hard reload 142 # FIXME: Should be done more properly without hard reload
144 LiberviaJsonProxy.onRemoteError(self, code, errobj, request_info) 143 LiberviaJsonProxy.onRemoteError(self, code, errobj, request_info)
145 #we now try to reconnect 144 #we now try to reconnect
146 if isinstance(errobj['message'],dict) and errobj['message']['faultCode']==0: 145 if isinstance(errobj['message'], dict) and errobj['message']['faultCode'] == 0:
147 Window.alert('You are not allowed to connect to server') 146 Window.alert('You are not allowed to connect to server')
148 else: 147 else:
149 def _timerCb(): 148 def _timerCb():
150 self.host.bridge_signals.call('getSignals', self.host._getSignalsCB) 149 self.host.bridge_signals.call('getSignals', self.host._getSignalsCB)
151 Timer(notify=_timerCb).schedule(self.retry_delay) 150 Timer(notify=_timerCb).schedule(self.retry_delay)
152 self.retry_delay *= 2 151 self.retry_delay *= 2
166 self.contact_panel = ContactPanel(self) 165 self.contact_panel = ContactPanel(self)
167 self.panel = panels.MainPanel(self) 166 self.panel = panels.MainPanel(self)
168 self.discuss_panel = self.panel.discuss_panel 167 self.discuss_panel = self.panel.discuss_panel
169 self.tab_panel = self.panel.tab_panel 168 self.tab_panel = self.panel.tab_panel
170 self.tab_panel.addTabListener(self) 169 self.tab_panel.addTabListener(self)
171 self.libervia_widgets = set() #keep track of all actives LiberviaWidgets
172 self.room_list = set() #set of rooms 170 self.room_list = set() #set of rooms
173 self.mblog_cache = [] #used to keep our own blog entries in memory, to show them in new mblog panel 171 self.libervia_widgets = set() # keep track of all actives LiberviaWidgets
174 self.avatars_cache = {} #keep track of jid's avatar hash (key=jid, value=file) 172 self.mblog_cache = [] # used to keep our own blog entries in memory, to show them in new mblog panel
173 self.avatars_cache = {} # keep track of jid's avatar hash (key=jid, value=file)
175 self.current_action_ids = set() 174 self.current_action_ids = set()
176 #self.discuss_panel.addWidget(panels.EmptyPanel(self)) 175 #self.discuss_panel.addWidget(panels.EmptyPanel(self))
177 self.discuss_panel.addWidget(panels.MicroblogPanel(self, [])) 176 self.discuss_panel.addWidget(panels.MicroblogPanel(self, []))
178 #self.discuss_panel.addWidget(panels.EmptyPanel(self)) 177 #self.discuss_panel.addWidget(panels.EmptyPanel(self))
179 self._register_box = None 178 self._register_box = None