Fix pep8 support in src/plugins.

This commit is contained in:
Emmanuel Gil Peyrot 2013-01-18 17:55:35 +01:00
commit 0dca274360

View file

@ -24,24 +24,25 @@ from twisted.words.protocols.jabber.xmlstream import XmlStream
from twisted.words.xish import domish
PLUGIN_INFO = {
"name": "Raw XML log Plugin",
"import_name": "XmlLog",
"type": "Misc",
"protocols": [],
"dependencies": [],
"main": "XmlLog",
"handler": "no",
"description": _("""Send raw XML logs to bridge""")
"name": "Raw XML log Plugin",
"import_name": "XmlLog",
"type": "Misc",
"protocols": [],
"dependencies": [],
"main": "XmlLog",
"handler": "no",
"description": _("""Send raw XML logs to bridge""")
}
class LoggingXmlStream(XmlStream):
"""This class send the raw XML to the Bridge, for logging purpose"""
def send(self, obj):
if isinstance(obj,basestring):
log=unicode(obj)
if isinstance(obj, basestring):
log = unicode(obj)
elif isinstance(obj, domish.Element):
log=obj.toXml()
log = obj.toXml()
else:
error(_('INTERNAL ERROR: Unmanaged XML type'))
self._host.bridge.xmlLog("OUT", log, self._profile)
@ -72,7 +73,7 @@ class XmlLog(object):
host.memory.importParams(self.params)
#bridge
host.bridge.addSignal("xmlLog", ".plugin", signature='sss') #args: direction("IN" or "OUT"), xml_data, profile
host.bridge.addSignal("xmlLog", ".plugin", signature='sss') # args: direction("IN" or "OUT"), xml_data, profile
do_log = self.host.memory.getParamA("Xml log", "Debug")
if do_log: