comparison src/core/sat_main.py @ 1059:b2b9c184033f

core, frontends: remove bridge method "connect" (always use asyncConnect)
author souliane <souliane@mailoo.org>
date Fri, 23 May 2014 10:40:54 +0200
parents e88bff4c8b77
children 6ec513ad92c2
comparison
equal deleted inserted replaced
1058:0a9986452bba 1059:b2b9c184033f
84 self.bridge.register("getProfileName", self.memory.getProfileName) 84 self.bridge.register("getProfileName", self.memory.getProfileName)
85 self.bridge.register("getProfilesList", self.memory.getProfilesList) 85 self.bridge.register("getProfilesList", self.memory.getProfilesList)
86 self.bridge.register("getEntityData", lambda _jid, keys, profile: self.memory.getEntityData(jid.JID(_jid), keys, profile)) 86 self.bridge.register("getEntityData", lambda _jid, keys, profile: self.memory.getEntityData(jid.JID(_jid), keys, profile))
87 self.bridge.register("asyncCreateProfile", self.memory.asyncCreateProfile) 87 self.bridge.register("asyncCreateProfile", self.memory.asyncCreateProfile)
88 self.bridge.register("asyncDeleteProfile", self.memory.asyncDeleteProfile) 88 self.bridge.register("asyncDeleteProfile", self.memory.asyncDeleteProfile)
89 self.bridge.register("connect", self.connect)
90 self.bridge.register("asyncConnect", self.asyncConnect) 89 self.bridge.register("asyncConnect", self.asyncConnect)
91 self.bridge.register("disconnect", self.disconnect) 90 self.bridge.register("disconnect", self.disconnect)
92 self.bridge.register("getContacts", self.getContacts) 91 self.bridge.register("getContacts", self.getContacts)
93 self.bridge.register("getContactsFromGroup", self.getContactsFromGroup) 92 self.bridge.register("getContactsFromGroup", self.getContactsFromGroup)
94 self.bridge.register("getLastResource", self.memory._getLastResource) 93 self.bridge.register("getLastResource", self.memory._getLastResource)
181 self.plugins[import_name].is_handler = True 180 self.plugins[import_name].is_handler = True
182 else: 181 else:
183 self.plugins[import_name].is_handler = False 182 self.plugins[import_name].is_handler = False
184 #TODO: test xmppclient presence and register handler parent 183 #TODO: test xmppclient presence and register handler parent
185 184
186 def connect(self, profile_key=C.PROF_KEY_NONE, password=''):
187 """Connect to jabber server
188
189 @param password (string): the SàT profile password
190 @param profile_key: %(doc_profile_key)s
191 """
192 self.asyncConnect(profile_key, password)
193
194 def asyncConnect(self, profile_key=C.PROF_KEY_NONE, password=''): 185 def asyncConnect(self, profile_key=C.PROF_KEY_NONE, password=''):
195 """Retrieve the individual parameters, authenticate the profile 186 """Retrieve the individual parameters, authenticate the profile
196 and initiate the connection to the associated XMPP server. 187 and initiate the connection to the associated XMPP server.
197 188
198 @param password (string): the SàT profile password 189 @param password (string): the SàT profile password
350 log.error(_("Trying to remove reference to a client not referenced")) 341 log.error(_("Trying to remove reference to a client not referenced"))
351 self.memory.purgeProfileSession(profile) 342 self.memory.purgeProfileSession(profile)
352 343
353 def startService(self): 344 def startService(self):
354 log.info(u"Salut à toi ô mon frère !") 345 log.info(u"Salut à toi ô mon frère !")
355 #TODO: manage autoconnect
356 #self.connect()
357 346
358 def stopService(self): 347 def stopService(self):
359 log.info(u"Salut aussi à Rantanplan") 348 log.info(u"Salut aussi à Rantanplan")
360 349
361 def run(self): 350 def run(self):