changeset 2195:d65275ac39b3

plugin XEP-0060: renamed psGet bridge method to psItemGet
author Goffi <goffi@goffi.org>
date Mon, 13 Mar 2017 23:17:13 +0100
parents 322948499db0
children d3e48c9a255e
files frontends/src/jp/cmd_pubsub.py src/plugins/plugin_xep_0060.py
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/jp/cmd_pubsub.py	Mon Mar 13 23:15:06 2017 +0100
+++ b/frontends/src/jp/cmd_pubsub.py	Mon Mar 13 23:17:13 2017 +0100
@@ -28,7 +28,7 @@
 class Get(base.CommandBase):
 
     def __init__(self, host):
-        base.CommandBase.__init__(self, host, 'get', use_verbose=True, use_output=C.OUTPUT_LIST_XML, help=_(u'get pubsub item(s)'))
+        base.CommandBase.__init__(self, host, 'get', use_output=C.OUTPUT_LIST_XML, help=_(u'get pubsub item(s)'))
         self.need_loop=True
 
     def add_parser_options(self):
@@ -44,17 +44,17 @@
         # TODO: add MAM filters
 
 
-    def psGetCb(self, ps_result):
+    def psItemGetCb(self, ps_result):
         self.output(ps_result[0])
         self.host.quit(C.EXIT_OK)
 
-    def psGetEb(self, failure_):
+    def psItemGetEb(self, failure_):
         self.disp(u"can't get pubsub items: {reason}".format(
             reason=failure_), error=True)
         self.host.quit(C.EXIT_BRIDGE_ERRBACK)
 
     def start(self):
-        self.host.bridge.psGet(
+        self.host.bridge.psItemGet(
             self.args.service,
             self.args.node,
             self.args.max,
@@ -62,8 +62,8 @@
             self.args.sub_id,
             {},
             self.profile,
-            callback=self.psGetCb,
-            errback=self.psGetEb)
+            callback=self.psItemGetCb,
+            errback=self.psItemGetEb)
 
 
 class Pubsub(base.CommandBase):
--- a/src/plugins/plugin_xep_0060.py	Mon Mar 13 23:15:06 2017 +0100
+++ b/src/plugins/plugin_xep_0060.py	Mon Mar 13 23:17:13 2017 +0100
@@ -85,8 +85,8 @@
         self._mam = host.plugins.get('XEP-0313')
         self._node_cb = {} # dictionnary of callbacks for node (key: node, value: list of callbacks)
         self.rt_sessions = sat_defer.RTDeferredSessions()
-        host.bridge.addMethod("psGet", ".plugin", in_sign='ssiassa{ss}s', out_sign='(asa{ss})', method=self._getItems, async=True)
         host.bridge.addMethod("psDeleteNode", ".plugin", in_sign='sss', out_sign='', method=self._deleteNode, async=True)
+        host.bridge.addMethod("psItemGet", ".plugin", in_sign='ssiassa{ss}s', out_sign='(asa{ss})', method=self._getItems, async=True)
         host.bridge.addMethod("psRetractItem", ".plugin", in_sign='sssbs', out_sign='', method=self._retractItem, async=True)
         host.bridge.addMethod("psRetractItems", ".plugin", in_sign='ssasbs', out_sign='', method=self._retractItems, async=True)
         host.bridge.addMethod("psSubscribeToMany", ".plugin", in_sign='a(ss)sa{ss}s', out_sign='s', method=self._subscribeToMany)