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.
This commit is contained in:
parent
da54c69eaa
commit
3eeeb8040c
1 changed files with 30 additions and 0 deletions
|
|
@ -383,6 +383,8 @@ class QuickApp(object):
|
|||
self.registerSignal("chatStateReceived", iface="plugin")
|
||||
self.registerSignal("messageState", iface="plugin")
|
||||
self.registerSignal("psEvent", iface="plugin")
|
||||
# useful for debugging
|
||||
self.registerSignal("_debug", iface="core")
|
||||
|
||||
# FIXME: do it dynamically
|
||||
quick_games.Tarot.registerSignals(self)
|
||||
|
|
@ -1099,6 +1101,14 @@ class QuickApp(object):
|
|||
answer_data=(entity, profile),
|
||||
)
|
||||
|
||||
def _debugHandler(self, action, parameters, profile):
|
||||
if action == u"widgets_dump":
|
||||
from pprint import pformat
|
||||
log.info(u"Widgets dump:\n{data}".format(data=pformat(self.widgets._widgets)))
|
||||
else:
|
||||
log.warning(u"Unknown debug action: {action}".format(action=action))
|
||||
|
||||
|
||||
def showDialog(self, message, title, type="info", answer_cb=None, answer_data=None):
|
||||
"""Show a dialog to user
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue