diff sat/plugins/plugin_misc_xmllog.py @ 3040:fee60f17ebac

jp: jp asyncio port: /!\ this commit is huge. Jp is temporarily not working with `dbus` bridge /!\ This patch implements the port of jp to asyncio, so it is now correctly using the bridge asynchronously, and it can be used with bridges like `pb`. This also simplify the code, notably for things which were previously implemented with many callbacks (like pagination with RSM). During the process, some behaviours have been modified/fixed, in jp and backends, check diff for details.
author Goffi <goffi@goffi.org>
date Wed, 25 Sep 2019 08:56:41 +0200
parents ab2696e34d29
children 559a625a236b
line wrap: on
line diff
--- a/sat/plugins/plugin_misc_xmllog.py	Wed Sep 25 08:53:38 2019 +0200
+++ b/sat/plugins/plugin_misc_xmllog.py	Wed Sep 25 08:56:41 2019 +0200
@@ -20,10 +20,10 @@
 from sat.core.i18n import _
 from sat.core.constants import Const as C
 from sat.core.log import getLogger
+from twisted.words.xish import domish
+from functools import partial
 
 log = getLogger(__name__)
-from twisted.words.xish import domish
-from functools import partial
 
 PLUGIN_INFO = {
     C.PI_NAME: "Raw XML log Plugin",
@@ -74,9 +74,9 @@
 
     def onSend(self, obj, client):
         if isinstance(obj, str):
-            log = str(obj)
+            xml_log = obj
         elif isinstance(obj, domish.Element):
-            log = obj.toXml()
+            xml_log = obj.toXml()
         else:
             log.error(_("INTERNAL ERROR: Unmanaged XML type"))
-        self.host.bridge.xmlLog("OUT", log, client.profile)
+        self.host.bridge.xmlLog("OUT", xml_log, client.profile)