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
4 changed files with 30 additions and 0 deletions
|
|
@ -183,6 +183,15 @@ doc_param_0=id: id of the progression operation
|
|||
doc_param_1=error: error message
|
||||
doc_param_2=%(doc_profile)s
|
||||
|
||||
[_debug]
|
||||
type=signal
|
||||
category=core
|
||||
sig_in=sa{ss}s
|
||||
doc=Debug method, useful for developers
|
||||
doc_param_0=action: action to do
|
||||
doc_param_1=params: action parameters
|
||||
doc_param_2=%(doc_profile)s
|
||||
|
||||
;methods
|
||||
|
||||
[getReady]
|
||||
|
|
|
|||
|
|
@ -128,6 +128,11 @@ class DbusObject(dbus.service.Object):
|
|||
# further investigations
|
||||
pass
|
||||
|
||||
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||
signature='sa{ss}s')
|
||||
def _debug(self, action, params, profile):
|
||||
pass
|
||||
|
||||
@dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||
signature='a{ss}sis')
|
||||
def actionNew(self, action_data, id, security_limit, profile):
|
||||
|
|
@ -681,6 +686,9 @@ class Bridge(object):
|
|||
self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus)
|
||||
self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH)
|
||||
|
||||
def _debug(self, action, params, profile):
|
||||
self.dbus_bridge._debug(action, params, profile)
|
||||
|
||||
def actionNew(self, action_data, id, security_limit, profile):
|
||||
self.dbus_bridge.actionNew(action_data, id, security_limit, profile)
|
||||
|
||||
|
|
|
|||
|
|
@ -135,6 +135,9 @@ class Bridge(object):
|
|||
"""
|
||||
self.root._bridgeReactivateSignals()
|
||||
|
||||
def _debug(self, action, params, profile):
|
||||
self.sendSignal("_debug", action, params, profile)
|
||||
|
||||
def actionNew(self, action_data, id, security_limit, profile):
|
||||
self.sendSignal("actionNew", action_data, id, security_limit, profile)
|
||||
|
||||
|
|
|
|||
|
|
@ -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