comparison src/plugins/plugin_xep_0060.py @ 587:952322b1d490

Remove trailing whitespaces.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 18 Jan 2013 17:55:34 +0100
parents ca13633d3b6b
children beaf6bec2fcd
comparison
equal deleted inserted replaced
586:6a718ede8be1 587:952322b1d490
90 raise Exception(err_mess) 90 raise Exception(err_mess)
91 return profile, client 91 return profile, client
92 92
93 def publish(self, service, nodeIdentifier, items=None, profile_key='@DEFAULT@'): 93 def publish(self, service, nodeIdentifier, items=None, profile_key='@DEFAULT@'):
94 profile,client = self.__getClientNProfile(profile_key, 'publish item') 94 profile,client = self.__getClientNProfile(profile_key, 'publish item')
95 return client.publish(service, nodeIdentifier, items, client.parent.jid) 95 return client.publish(service, nodeIdentifier, items, client.parent.jid)
96 96
97 def getItems(self, service, node, max_items=None, sub_id=None, profile_key='@DEFAULT@'): 97 def getItems(self, service, node, max_items=None, sub_id=None, profile_key='@DEFAULT@'):
98 profile,client = self.__getClientNProfile(profile_key, 'get items') 98 profile,client = self.__getClientNProfile(profile_key, 'get items')
99 return client.items(service, node, max_items, sub_id, client.parent.jid) 99 return client.items(service, node, max_items, sub_id, client.parent.jid)
100 100
103 return client.getOptions(service, nodeIdentifier, subscriber, subscriptionIdentifier) 103 return client.getOptions(service, nodeIdentifier, subscriber, subscriptionIdentifier)
104 104
105 def setOptions(self, service, nodeIdentifier, subscriber, options, subscriptionIdentifier=None, profile_key='@DEFAULT@'): 105 def setOptions(self, service, nodeIdentifier, subscriber, options, subscriptionIdentifier=None, profile_key='@DEFAULT@'):
106 profile,client = self.__getClientNProfile(profile_key, 'set options') 106 profile,client = self.__getClientNProfile(profile_key, 'set options')
107 return client.setOptions(service, nodeIdentifier, subscriber, options, subscriptionIdentifier) 107 return client.setOptions(service, nodeIdentifier, subscriber, options, subscriptionIdentifier)
108 108
109 def createNode(self, service, nodeIdentifier, options, profile_key='@DEFAULT@'): 109 def createNode(self, service, nodeIdentifier, options, profile_key='@DEFAULT@'):
110 profile,client = self.__getClientNProfile(profile_key, 'create node') 110 profile,client = self.__getClientNProfile(profile_key, 'create node')
111 return client.createNode(service, nodeIdentifier, options) 111 return client.createNode(service, nodeIdentifier, options)
112 112
113 def deleteNode(self, service, nodeIdentifier, profile_key='@DEFAULT@'): 113 def deleteNode(self, service, nodeIdentifier, profile_key='@DEFAULT@'):
114 profile,client = self.__getClientNProfile(profile_key, 'delete node') 114 profile,client = self.__getClientNProfile(profile_key, 'delete node')
115 return client.deleteNode(service, nodeIdentifier) 115 return client.deleteNode(service, nodeIdentifier)
116 116
117 def subscribe(self, service, nodeIdentifier, sub_jid = None, options=None, profile_key='@DEFAULT@'): 117 def subscribe(self, service, nodeIdentifier, sub_jid = None, options=None, profile_key='@DEFAULT@'):
118 profile,client = self.__getClientNProfile(profile_key, 'subscribe node') 118 profile,client = self.__getClientNProfile(profile_key, 'subscribe node')
119 return client.subscribe(service, nodeIdentifier, sub_jid or client.parent.jid.userhostJID(), options=options) 119 return client.subscribe(service, nodeIdentifier, sub_jid or client.parent.jid.userhostJID(), options=options)
120 120
121 121
122 class SatPubSubClient(pubsub.PubSubClient): 122 class SatPubSubClient(pubsub.PubSubClient):
123 implements(disco.IDisco) 123 implements(disco.IDisco)
124 124
125 def __init__(self, host, parent_plugin): 125 def __init__(self, host, parent_plugin):
126 self.host=host 126 self.host=host
127 self.parent_plugin = parent_plugin 127 self.parent_plugin = parent_plugin
128 pubsub.PubSubClient.__init__(self) 128 pubsub.PubSubClient.__init__(self)
129 129
130 def connectionInitialized(self): 130 def connectionInitialized(self):
131 pubsub.PubSubClient.connectionInitialized(self) 131 pubsub.PubSubClient.connectionInitialized(self)
132 132
133 def itemsReceived(self, event): 133 def itemsReceived(self, event):
134 if not self.host.trigger.point("PubSubItemsReceived", event, self.parent.profile): 134 if not self.host.trigger.point("PubSubItemsReceived", event, self.parent.profile):
135 return 135 return
136 for node in self.parent_plugin.managedNodes: 136 for node in self.parent_plugin.managedNodes:
137 if event.nodeIdentifier == node[0]: 137 if event.nodeIdentifier == node[0]:
147 147
148 def getDiscoInfo(self, requestor, target, nodeIdentifier=''): 148 def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
149 _disco_info = [] 149 _disco_info = []
150 self.host.trigger.point("PubSub Disco Info", _disco_info, self.parent.profile) 150 self.host.trigger.point("PubSub Disco Info", _disco_info, self.parent.profile)
151 return _disco_info 151 return _disco_info
152 152
153 def getDiscoItems(self, requestor, target, nodeIdentifier=''): 153 def getDiscoItems(self, requestor, target, nodeIdentifier=''):
154 return [] 154 return []
155 155