comparison libervia.py @ 128:2849ec993d89

basic radio collective
author Goffi <goffi@goffi.org>
date Mon, 23 Jan 2012 00:15:19 +0100
parents e19a8de8b3de
children 6576c5a90060
comparison
equal deleted inserted replaced
127:e19a8de8b3de 128:2849ec993d89
241 name == 'tarotGameYourTurn' or \ 241 name == 'tarotGameYourTurn' or \
242 name == 'tarotGameScore': 242 name == 'tarotGameScore':
243 self._tarotGameGenericCb(name, args[0], args[1:]) 243 self._tarotGameGenericCb(name, args[0], args[1:])
244 elif name == 'radiocolStarted': 244 elif name == 'radiocolStarted':
245 self._radioColStartedCb(*args) 245 self._radioColStartedCb(*args)
246 elif name == 'radiocolPreload':
247 self._radioColGenericCb(name, args[0], args[1:])
246 elif name == 'subscribe': 248 elif name == 'subscribe':
247 self._subscribeCb(*args) 249 self._subscribeCb(*args)
248 elif name == 'contactDeleted': 250 elif name == 'contactDeleted':
249 self._contactDeletedCb(*args) 251 self._contactDeletedCb(*args)
250 elif name == 'newContact': 252 elif name == 'newContact':
358 def _radioColStartedCb(self, room_jid, referee): 360 def _radioColStartedCb(self, room_jid, referee):
359 for lib_wid in self.libervia_widgets: 361 for lib_wid in self.libervia_widgets:
360 if isinstance(lib_wid,panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid: 362 if isinstance(lib_wid,panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid:
361 lib_wid.startGame("RadioCol", referee) 363 lib_wid.startGame("RadioCol", referee)
362 364
365 def _radioColGenericCb(self, event_name, room_jid, args):
366 for lib_wid in self.libervia_widgets:
367 if isinstance(lib_wid,panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid:
368 getattr(lib_wid.getGame("RadioCol"), event_name)(*args)
369
370
363 def _getPresenceStatusCb(self, presence_data): 371 def _getPresenceStatusCb(self, presence_data):
364 for entity in presence_data: 372 for entity in presence_data:
365 for resource in presence_data[entity]: 373 for resource in presence_data[entity]:
366 args = presence_data[entity][resource] 374 args = presence_data[entity][resource]
367 self._presenceUpdateCb("%s/%s" % (entity, resource), *args) 375 self._presenceUpdateCb("%s/%s" % (entity, resource), *args)