diff src/plugins/plugin_xep_0060.py @ 916:1a759096ccbd

core: use of Const for profile_key + replaced '@DEFAULT@' default profile_key by '@NONE@'
author Goffi <goffi@goffi.org>
date Fri, 21 Mar 2014 16:27:09 +0100
parents a7b2aacf22ac
children 301b342c697a
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0060.py	Fri Mar 21 16:19:46 2014 +0100
+++ b/src/plugins/plugin_xep_0060.py	Fri Mar 21 16:27:09 2014 +0100
@@ -18,6 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from sat.core.i18n import _
+from sat.core.constants import Const as C
 from logging import debug, info, error
 from wokkel.pubsub import PubSubRequest
 from wokkel import disco, pubsub
@@ -95,35 +96,35 @@
             raise Exception(err_mess)
         return profile, client
 
-    def publish(self, service, nodeIdentifier, items=None, profile_key='@DEFAULT@'):
+    def publish(self, service, nodeIdentifier, items=None, profile_key=C.PROF_KEY_NONE):
         profile, client = self.__getClientNProfile(profile_key, 'publish item')
         return client.publish(service, nodeIdentifier, items, client.parent.jid)
 
-    def getItems(self, service, node, max_items=None, item_ids=None, sub_id=None, profile_key='@DEFAULT@'):
+    def getItems(self, service, node, max_items=None, item_ids=None, sub_id=None, profile_key=C.PROF_KEY_NONE):
         profile, client = self.__getClientNProfile(profile_key, 'get items')
         return client.items(service, node, max_items, item_ids, sub_id, client.parent.jid)
 
-    def getOptions(self, service, nodeIdentifier, subscriber, subscriptionIdentifier=None, profile_key='@DEFAULT@'):
+    def getOptions(self, service, nodeIdentifier, subscriber, subscriptionIdentifier=None, profile_key=C.PROF_KEY_NONE):
         profile, client = self.__getClientNProfile(profile_key, 'get options')
         return client.getOptions(service, nodeIdentifier, subscriber, subscriptionIdentifier)
 
-    def setOptions(self, service, nodeIdentifier, subscriber, options, subscriptionIdentifier=None, profile_key='@DEFAULT@'):
+    def setOptions(self, service, nodeIdentifier, subscriber, options, subscriptionIdentifier=None, profile_key=C.PROF_KEY_NONE):
         profile, client = self.__getClientNProfile(profile_key, 'set options')
         return client.setOptions(service, nodeIdentifier, subscriber, options, subscriptionIdentifier)
 
-    def createNode(self, service, nodeIdentifier, options, profile_key='@DEFAULT@'):
+    def createNode(self, service, nodeIdentifier, options, profile_key=C.PROF_KEY_NONE):
         profile, client = self.__getClientNProfile(profile_key, 'create node')
         return client.createNode(service, nodeIdentifier, options)
 
-    def deleteNode(self, service, nodeIdentifier, profile_key='@DEFAULT@'):
+    def deleteNode(self, service, nodeIdentifier, profile_key=C.PROF_KEY_NONE):
         profile, client = self.__getClientNProfile(profile_key, 'delete node')
         return client.deleteNode(service, nodeIdentifier)
 
-    def retractItems(self, service, nodeIdentifier, itemIdentifiers, profile_key='@DEFAULT@'):
+    def retractItems(self, service, nodeIdentifier, itemIdentifiers, profile_key=C.PROF_KEY_NONE):
         profile, client = self.__getClientNProfile(profile_key, 'retract items')
         return client.retractItems(service, nodeIdentifier, itemIdentifiers)
 
-    def subscribe(self, service, nodeIdentifier, sub_jid=None, options=None, profile_key='@DEFAULT@'):
+    def subscribe(self, service, nodeIdentifier, sub_jid=None, options=None, profile_key=C.PROF_KEY_NONE):
         profile, client = self.__getClientNProfile(profile_key, 'subscribe node')
         return client.subscribe(service, nodeIdentifier, sub_jid or client.parent.jid.userhostJID(), options=options)