Mercurial > libervia-backend
comparison sat_frontends/quick_frontend/quick_app.py @ 2854:eb9fa72eb62b
core: added a "_debug" signal:
this signal is a generic debugging signal which can be implemented in frontends to do specific actions, like printing data dumps.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 10 Mar 2019 18:04:01 +0100 |
parents | b9da74c9d46e |
children | e9e33e05d143 |
comparison
equal
deleted
inserted
replaced
2853:6901a425d882 | 2854:eb9fa72eb62b |
---|---|
381 self.registerSignal("mucRoomUserChangedNick", iface="plugin") | 381 self.registerSignal("mucRoomUserChangedNick", iface="plugin") |
382 self.registerSignal("mucRoomNewSubject", iface="plugin") | 382 self.registerSignal("mucRoomNewSubject", iface="plugin") |
383 self.registerSignal("chatStateReceived", iface="plugin") | 383 self.registerSignal("chatStateReceived", iface="plugin") |
384 self.registerSignal("messageState", iface="plugin") | 384 self.registerSignal("messageState", iface="plugin") |
385 self.registerSignal("psEvent", iface="plugin") | 385 self.registerSignal("psEvent", iface="plugin") |
386 # useful for debugging | |
387 self.registerSignal("_debug", iface="core") | |
386 | 388 |
387 # FIXME: do it dynamically | 389 # FIXME: do it dynamically |
388 quick_games.Tarot.registerSignals(self) | 390 quick_games.Tarot.registerSignals(self) |
389 quick_games.Quiz.registerSignals(self) | 391 quick_games.Quiz.registerSignals(self) |
390 quick_games.Radiocol.registerSignals(self) | 392 quick_games.Radiocol.registerSignals(self) |
1097 "yes/no", | 1099 "yes/no", |
1098 answer_cb=self._subscribe_cb, | 1100 answer_cb=self._subscribe_cb, |
1099 answer_data=(entity, profile), | 1101 answer_data=(entity, profile), |
1100 ) | 1102 ) |
1101 | 1103 |
1104 def _debugHandler(self, action, parameters, profile): | |
1105 if action == u"widgets_dump": | |
1106 from pprint import pformat | |
1107 log.info(u"Widgets dump:\n{data}".format(data=pformat(self.widgets._widgets))) | |
1108 else: | |
1109 log.warning(u"Unknown debug action: {action}".format(action=action)) | |
1110 | |
1111 | |
1102 def showDialog(self, message, title, type="info", answer_cb=None, answer_data=None): | 1112 def showDialog(self, message, title, type="info", answer_cb=None, answer_data=None): |
1103 """Show a dialog to user | 1113 """Show a dialog to user |
1104 | 1114 |
1105 Frontends must override this method | 1115 Frontends must override this method |
1106 @param message(unicode): body of the dialog | 1116 @param message(unicode): body of the dialog |