Mercurial > libervia-backend
comparison src/plugins/plugin_misc_groupblog.py @ 1552:e0bde0d0b321
core (disco): use of “profile” instead of “profile_key” in several disco methods
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 02 Nov 2015 22:02:41 +0100 |
parents | afa0894dcc71 |
children | 9aa2a703e460 |
comparison
equal
deleted
inserted
replaced
1551:591c32dbfb0b | 1552:e0bde0d0b321 |
---|---|
21 from sat.core.constants import Const as C | 21 from sat.core.constants import Const as C |
22 from sat.core.log import getLogger | 22 from sat.core.log import getLogger |
23 log = getLogger(__name__) | 23 log = getLogger(__name__) |
24 from twisted.internet import defer | 24 from twisted.internet import defer |
25 from twisted.words.protocols.jabber import jid | 25 from twisted.words.protocols.jabber import jid |
26 from twisted.words.xish.domish import Element, generateElementsNamed | 26 from twisted.words.xish.domish import generateElementsNamed |
27 from sat.core import exceptions | 27 from sat.core import exceptions |
28 from wokkel import disco, data_form, iwokkel | 28 from wokkel import disco, data_form, iwokkel |
29 from wokkel import rsm | 29 from wokkel import rsm |
30 from zope.interface import implements | 30 from zope.interface import implements |
31 # import uuid | 31 # import uuid |
138 | 138 |
139 @defer.inlineCallbacks | 139 @defer.inlineCallbacks |
140 def profileConnected(self, profile): | 140 def profileConnected(self, profile): |
141 client = self.host.getClient(profile) | 141 client = self.host.getClient(profile) |
142 try: | 142 try: |
143 yield self.host.checkFeatures((NS_PUBSUB_GROUPBLOG, NS_PUBSUB_AUTO_CREATE), profile_key=profile) | 143 yield self.host.checkFeatures((NS_PUBSUB_GROUPBLOG, NS_PUBSUB_AUTO_CREATE), profile=profile) |
144 except exceptions.FeatureNotFound: | 144 except exceptions.FeatureNotFound: |
145 client.server_groupblog_available = False | 145 client.server_groupblog_available = False |
146 log.warning(_(u"Server is not able to manage item-access pubsub, we can't use group blog")) | 146 log.warning(_(u"Server is not able to manage item-access pubsub, we can't use group blog")) |
147 else: | 147 else: |
148 client.server_groupblog_available = True | 148 client.server_groupblog_available = True |
175 | 175 |
176 #we first check that we have a item-access pubsub server | 176 #we first check that we have a item-access pubsub server |
177 if not hasattr(client, "item_access_pubsub"): | 177 if not hasattr(client, "item_access_pubsub"): |
178 log.debug(_('Looking for item-access powered pubsub server')) | 178 log.debug(_('Looking for item-access powered pubsub server')) |
179 #we don't have any pubsub server featuring item access yet | 179 #we don't have any pubsub server featuring item access yet |
180 item_access_pubsubs = yield self.host.findFeaturesSet((NS_PUBSUB_AUTO_CREATE, NS_PUBSUB_CREATOR_JID_CHECK), "pubsub", "service", profile_key=profile) | 180 item_access_pubsubs = yield self.host.findFeaturesSet((NS_PUBSUB_AUTO_CREATE, NS_PUBSUB_CREATOR_JID_CHECK), "pubsub", "service", profile=profile) |
181 # item_access_pubsubs = yield self.host.findFeaturesSet((NS_PUBSUB_ITEM_ACCESS, NS_PUBSUB_AUTO_CREATE, NS_PUBSUB_CREATOR_JID_CHECK), "pubsub", "service", profile_key=profile) | 181 # item_access_pubsubs = yield self.host.findFeaturesSet((NS_PUBSUB_ITEM_ACCESS, NS_PUBSUB_AUTO_CREATE, NS_PUBSUB_CREATOR_JID_CHECK), "pubsub", "service", profile_key=profile) |
182 try: | 182 try: |
183 client.item_access_pubsub = item_access_pubsubs.pop() | 183 client.item_access_pubsub = item_access_pubsubs.pop() |
184 log.info(_(u"item-access powered pubsub service found: [%s]") % client.item_access_pubsub.full()) | 184 log.info(_(u"item-access powered pubsub service found: [%s]") % client.item_access_pubsub.full()) |
185 except KeyError: | 185 except KeyError: |