core, frontends: remove bridge method "connect" (always use asyncConnect)
This commit is contained in:
parent
f09fb76752
commit
f719875f0b
6 changed files with 2 additions and 38 deletions
|
|
@ -114,9 +114,6 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
def confirmationAnswer(self, id, accepted, data, profile):
|
||||
return self.db_core_iface.confirmationAnswer(id, accepted, data, profile)
|
||||
|
||||
def connect(self, profile_key="@DEFAULT@", password=''):
|
||||
return self.db_core_iface.connect(profile_key, password)
|
||||
|
||||
def delContact(self, entity_jid, profile_key="@DEFAULT@"):
|
||||
return self.db_core_iface.delContact(entity_jid, profile_key)
|
||||
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ class PrimitivusApp(QuickApp, InputHistory):
|
|||
|
||||
#MENU EVENTS#
|
||||
def onConnectRequest(self, menu):
|
||||
self.bridge.connect(self.profile)
|
||||
self.bridge.asyncConnect(self.profile, callback=lambda dummy: None)
|
||||
|
||||
def onDisconnectRequest(self, menu):
|
||||
self.bridge.disconnect(self.profile)
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
self.chat_wins[jid.bare].Show()
|
||||
|
||||
def onConnectRequest(self, e):
|
||||
self.bridge.connect(self.profile)
|
||||
self.bridge.asyncConnect(self.profile, callback=lambda dummy: None)
|
||||
|
||||
def onDisconnectRequest(self, e):
|
||||
self.bridge.disconnect(self.profile)
|
||||
|
|
|
|||
|
|
@ -223,12 +223,6 @@ class DbusObject(dbus.service.Object):
|
|||
def confirmationAnswer(self, id, accepted, data, profile):
|
||||
return self._callback("confirmationAnswer", unicode(id), accepted, data, unicode(profile))
|
||||
|
||||
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||
in_signature='ss', out_signature='b',
|
||||
async_callbacks=None)
|
||||
def connect(self, profile_key="@DEFAULT@", password=''):
|
||||
return self._callback("connect", unicode(profile_key), unicode(password))
|
||||
|
||||
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
|
||||
in_signature='ss', out_signature='',
|
||||
async_callbacks=None)
|
||||
|
|
|
|||
|
|
@ -228,22 +228,6 @@ errback is called with error constant as parameter:
|
|||
- ProfileUnknownError: the profile name is unknown
|
||||
- ConnectedProfileError: a connected profile would not be deleted
|
||||
|
||||
[connect]
|
||||
type=method
|
||||
category=core
|
||||
sig_in=ss
|
||||
sig_out=b
|
||||
param_0_default="@DEFAULT@"
|
||||
param_1_default=''
|
||||
doc=Connect a profile
|
||||
doc_param_0=%(doc_profile_key)s
|
||||
doc_param_1=password: the SàT profile password
|
||||
doc_return=a deferred boolean or failure:
|
||||
- boolean if the profile authentication succeed:
|
||||
- True if the XMPP connection was already established
|
||||
- False if the XMPP connection has been initiated (it may still fail)
|
||||
- failure if the profile authentication failed
|
||||
|
||||
[asyncConnect]
|
||||
async=
|
||||
type=method
|
||||
|
|
|
|||
|
|
@ -86,7 +86,6 @@ class SAT(service.Service):
|
|||
self.bridge.register("getEntityData", lambda _jid, keys, profile: self.memory.getEntityData(jid.JID(_jid), keys, profile))
|
||||
self.bridge.register("asyncCreateProfile", self.memory.asyncCreateProfile)
|
||||
self.bridge.register("asyncDeleteProfile", self.memory.asyncDeleteProfile)
|
||||
self.bridge.register("connect", self.connect)
|
||||
self.bridge.register("asyncConnect", self.asyncConnect)
|
||||
self.bridge.register("disconnect", self.disconnect)
|
||||
self.bridge.register("getContacts", self.getContacts)
|
||||
|
|
@ -183,14 +182,6 @@ class SAT(service.Service):
|
|||
self.plugins[import_name].is_handler = False
|
||||
#TODO: test xmppclient presence and register handler parent
|
||||
|
||||
def connect(self, profile_key=C.PROF_KEY_NONE, password=''):
|
||||
"""Connect to jabber server
|
||||
|
||||
@param password (string): the SàT profile password
|
||||
@param profile_key: %(doc_profile_key)s
|
||||
"""
|
||||
self.asyncConnect(profile_key, password)
|
||||
|
||||
def asyncConnect(self, profile_key=C.PROF_KEY_NONE, password=''):
|
||||
"""Retrieve the individual parameters, authenticate the profile
|
||||
and initiate the connection to the associated XMPP server.
|
||||
|
|
@ -352,8 +343,6 @@ class SAT(service.Service):
|
|||
|
||||
def startService(self):
|
||||
log.info(u"Salut à toi ô mon frère !")
|
||||
#TODO: manage autoconnect
|
||||
#self.connect()
|
||||
|
||||
def stopService(self):
|
||||
log.info(u"Salut aussi à Rantanplan")
|
||||
|
|
|
|||
Loading…
Reference in a new issue