Mercurial > libervia-backend
comparison src/plugins/plugin_misc_xmllog.py @ 285:6422fcdd831c
plugin XML Log: fixed dbus signal name
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 04 Feb 2011 00:17:56 +0100 |
parents | 345844caf048 |
children | f964dcec1611 |
comparison
equal
deleted
inserted
replaced
284:c25371424090 | 285:6422fcdd831c |
---|---|
42 log=unicode(obj) | 42 log=unicode(obj) |
43 elif isinstance(obj, domish.Element): | 43 elif isinstance(obj, domish.Element): |
44 log=obj.toXml() | 44 log=obj.toXml() |
45 else: | 45 else: |
46 error(_('INTERNAL ERROR: Unmanaged XML type')) | 46 error(_('INTERNAL ERROR: Unmanaged XML type')) |
47 self._host.bridge.XmlLog("OUT", log, self._profile) | 47 self._host.bridge.xmlLog("OUT", log, self._profile) |
48 return XmlStream.send(self, obj) | 48 return XmlStream.send(self, obj) |
49 | 49 |
50 def dataReceived(self, data): | 50 def dataReceived(self, data): |
51 self._host.bridge.XmlLog("IN", data.decode('utf-8'), self._profile) | 51 self._host.bridge.xmlLog("IN", data.decode('utf-8'), self._profile) |
52 return XmlStream.dataReceived(self, data) | 52 return XmlStream.dataReceived(self, data) |
53 | 53 |
54 | 54 |
55 class XmlLog(): | 55 class XmlLog(): |
56 | 56 |
70 | 70 |
71 #parameters | 71 #parameters |
72 host.memory.importParams(self.params) | 72 host.memory.importParams(self.params) |
73 | 73 |
74 #bridge | 74 #bridge |
75 host.bridge.addSignal("XmlLog", ".communication", signature='sss') #args: direction("IN" or "OUT"), xml_data, profile | 75 host.bridge.addSignal("xmlLog", ".communication", signature='sss') #args: direction("IN" or "OUT"), xml_data, profile |
76 | 76 |
77 do_log = bool(self.host.memory.getParamA("Xml log", "Debug")) | 77 do_log = bool(self.host.memory.getParamA("Xml log", "Debug")) |
78 if do_log: | 78 if do_log: |
79 info(_("XML log activated")) | 79 info(_("XML log activated")) |
80 host.trigger.add("XML Initialized", self.logXml) | 80 host.trigger.add("XML Initialized", self.logXml) |