Mercurial > libervia-backend
diff src/plugins/plugin_xep_0060.py @ 594:e629371a28d3
Fix pep8 support in src/plugins.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 18 Jan 2013 17:55:35 +0100 |
parents | beaf6bec2fcd |
children | 84a6e83157c2 |
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0060.py Mon Jan 21 00:59:50 2013 +0100 +++ b/src/plugins/plugin_xep_0060.py Fri Jan 18 17:55:35 2013 +0100 @@ -30,23 +30,24 @@ from zope.interface import implements PLUGIN_INFO = { -"name": "Publish-Subscribe", -"import_name": "XEP-0060", -"type": "XEP", -"protocols": ["XEP-0060"], -"dependencies": [], -"main": "XEP_0060", -"handler": "yes", -"description": _("""Implementation of PubSub Protocol""") + "name": "Publish-Subscribe", + "import_name": "XEP-0060", + "type": "XEP", + "protocols": ["XEP-0060"], + "dependencies": [], + "main": "XEP_0060", + "handler": "yes", + "description": _("""Implementation of PubSub Protocol""") } + class XEP_0060(object): def __init__(self, host): info(_("PubSub plugin initialization")) self.host = host - self.managedNodes=[] - self.clients={} + self.managedNodes = [] + self.clients = {} """host.bridge.addMethod("getItems", ".plugin", in_sign='ssa{ss}s', out_sign='as', method=self.getItems, async = True, doc = { 'summary':'retrieve items', @@ -78,8 +79,8 @@ profile = self.host.memory.getProfileName(profile_key) if not profile: err_mess = _('Trying to %(action)s with an unknown profile key [%(profile_key)s]') % { - 'action':action, - 'profile_key':profile_key} + 'action': action, + 'profile_key': profile_key} error(err_mess) raise Exception(err_mess) try: @@ -91,31 +92,31 @@ return profile, client def publish(self, service, nodeIdentifier, items=None, profile_key='@DEFAULT@'): - profile,client = self.__getClientNProfile(profile_key, 'publish item') + 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, sub_id=None, profile_key='@DEFAULT@'): - profile,client = self.__getClientNProfile(profile_key, 'get items') + profile, client = self.__getClientNProfile(profile_key, 'get items') return client.items(service, node, max_items, sub_id, client.parent.jid) def getOptions(self, service, nodeIdentifier, subscriber, subscriptionIdentifier=None, profile_key='@DEFAULT@'): - profile,client = self.__getClientNProfile(profile_key, 'get options') + 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@'): - profile,client = self.__getClientNProfile(profile_key, 'set options') + 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@'): - profile,client = self.__getClientNProfile(profile_key, 'create node') + profile, client = self.__getClientNProfile(profile_key, 'create node') return client.createNode(service, nodeIdentifier, options) def deleteNode(self, service, nodeIdentifier, profile_key='@DEFAULT@'): - profile,client = self.__getClientNProfile(profile_key, 'delete node') + profile, client = self.__getClientNProfile(profile_key, 'delete node') return client.deleteNode(service, nodeIdentifier) - def subscribe(self, service, nodeIdentifier, sub_jid = None, options=None, profile_key='@DEFAULT@'): - profile,client = self.__getClientNProfile(profile_key, 'subscribe node') + def subscribe(self, service, nodeIdentifier, sub_jid=None, options=None, profile_key='@DEFAULT@'): + profile, client = self.__getClientNProfile(profile_key, 'subscribe node') return client.subscribe(service, nodeIdentifier, sub_jid or client.parent.jid.userhostJID(), options=options) @@ -123,7 +124,7 @@ implements(disco.IDisco) def __init__(self, host, parent_plugin): - self.host=host + self.host = host self.parent_plugin = parent_plugin pubsub.PubSubClient.__init__(self) @@ -152,4 +153,3 @@ def getDiscoItems(self, requestor, target, nodeIdentifier=''): return [] -