diff sat_frontends/jp/base.py @ 3586:5f65f4e9f8cb

plugin XEP-0060: getItems extra is now serialised dict
author Goffi <goffi@goffi.org>
date Wed, 28 Jul 2021 23:01:15 +0200
parents 04283582966f
children 1709f0a78f50
line wrap: on
line diff
--- a/sat_frontends/jp/base.py	Wed Jul 28 22:15:31 2021 +0200
+++ b/sat_frontends/jp/base.py	Wed Jul 28 23:01:15 2021 +0200
@@ -41,6 +41,7 @@
 from sat.tools.common import uri
 from sat.tools.common import date_utils
 from sat.tools.common import utils
+from sat.tools.common import data_format
 from sat.tools.common.ansi import ANSI as A
 from sat.core import exceptions
 import sat_frontends.jp
@@ -1189,11 +1190,11 @@
                 _('trying to use output when use_output has not been set'))
         return self.host.output(output_type, self.args.output, self.extra_outputs, data)
 
-    def getPubsubExtra(self, extra=None):
+    def getPubsubExtra(self, extra: Optional[dict] = None) -> str:
         """Helper method to compute extra data from pubsub arguments
 
-        @param extra(None, dict): base extra dict, or None to generate a new one
-        @return (dict): dict which can be used directly in the bridge for pubsub
+        @param extra: base extra dict, or None to generate a new one
+        @return: dict which can be used directly in the bridge for pubsub
         """
         if extra is None:
             extra = {}
@@ -1234,7 +1235,7 @@
         else:
             if order_by is not None:
                 extra[C.KEY_ORDER_BY] = self.args.order_by
-        return extra
+        return data_format.serialise(extra)
 
     def add_parser_options(self):
         try: