comparison src/plugins/plugin_xep_0100.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
46 def __inc_handled_items(self, request_id, profile): 46 def __inc_handled_items(self, request_id, profile):
47 self.__gateways[request_id]['__handled_items']+=1 47 self.__gateways[request_id]['__handled_items']+=1
48 48
49 if self.__gateways[request_id]['__total_items'] == self.__gateways[request_id]['__handled_items']: 49 if self.__gateways[request_id]['__total_items'] == self.__gateways[request_id]['__handled_items']:
50 debug (_("All items checked for id [%s]") % str(request_id)) 50 debug (_("All items checked for id [%s]") % str(request_id))
51 51
52 del self.__gateways[request_id]['__total_items'] 52 del self.__gateways[request_id]['__total_items']
53 del self.__gateways[request_id]['__handled_items'] 53 del self.__gateways[request_id]['__handled_items']
54 self.host.actionResultExt(request_id,"DICT_DICT",self.__gateways[request_id], profile) 54 self.host.actionResultExt(request_id,"DICT_DICT",self.__gateways[request_id], profile)
55 55
56 def discoInfo(self, disco, entity, request_id, profile): 56 def discoInfo(self, disco, entity, request_id, profile):
63 'name':disco.identities[identity], 63 'name':disco.identities[identity],
64 'type':identity[1] 64 'type':identity[1]
65 } 65 }
66 66
67 self.__inc_handled_items(request_id, profile) 67 self.__inc_handled_items(request_id, profile)
68 68
69 def discoInfoErr(self, failure, entity, request_id, profile): 69 def discoInfoErr(self, failure, entity, request_id, profile):
70 """Something is going wrong with disco""" 70 """Something is going wrong with disco"""
71 failure.trap(jab_error.StanzaError,twisted.internet.error.ConnectionLost) 71 failure.trap(jab_error.StanzaError,twisted.internet.error.ConnectionLost)
72 error(_("Error when discovering [%(jid)s]: %(error)s") % {'jid':entity.full(), 'error':failure.getErrorMessage()}) 72 error(_("Error when discovering [%(jid)s]: %(error)s") % {'jid':entity.full(), 'error':failure.getErrorMessage()})
73 self.__inc_handled_items(request_id, profile) 73 self.__inc_handled_items(request_id, profile)
74 74
75 75
76 def discoItems(self, disco, request_id, target, client): 76 def discoItems(self, disco, request_id, target, client):
77 """Look for items with disco protocol, and ask infos for each one""" 77 """Look for items with disco protocol, and ask infos for each one"""
78 #FIXME: target is used as we can't find the original iq node (parent is None) 78 #FIXME: target is used as we can't find the original iq node (parent is None)
79 # an other way would avoid this useless parameter (is there a way with wokkel ?) 79 # an other way would avoid this useless parameter (is there a way with wokkel ?)
80 if len(disco._items) == 0: 80 if len(disco._items) == 0:
98 def registrationSuccessful(self, target, profile): 98 def registrationSuccessful(self, target, profile):
99 """Called when in_band registration is ok, we must now follow the rest of procedure""" 99 """Called when in_band registration is ok, we must now follow the rest of procedure"""
100 debug (_("Registration successful, doing the rest")) 100 debug (_("Registration successful, doing the rest"))
101 self.host.addContact(target, profile) 101 self.host.addContact(target, profile)
102 self.host.setPresence(target, profile) 102 self.host.setPresence(target, profile)
103 103
104 def gatewayRegister(self, action, target, fields, profile_key='@DEFAULT@'): 104 def gatewayRegister(self, action, target, fields, profile_key='@DEFAULT@'):
105 """Register gateway using in-band registration, then log-in to gateway""" 105 """Register gateway using in-band registration, then log-in to gateway"""
106 profile = self.host.memory.getProfileName(profile_key) 106 profile = self.host.memory.getProfileName(profile_key)
107 assert(profile) #FIXME: return an error here 107 assert(profile) #FIXME: return an error here
108 if action == 'SUBMIT': 108 if action == 'SUBMIT':