comparison src/core/sat_main.py @ 558:626e85e46d7c

core: port parameter is used
author Goffi <goffi@goffi.org>
date Sun, 16 Dec 2012 18:01:50 +0100
parents f25eef861b43
children ca13633d3b6b
comparison
equal deleted inserted replaced
557:4f856dd4c0d0 558:626e85e46d7c
24 'client_version' : u'0.2.0D', #Please add 'D' at the end for dev versions 24 'client_version' : u'0.2.0D', #Please add 'D' at the end for dev versions
25 } 25 }
26 26
27 from twisted.application import service 27 from twisted.application import service
28 from twisted.internet import defer 28 from twisted.internet import defer
29 from twisted.internet.defer import inlineCallbacks, returnValue
30 29
31 from twisted.words.protocols.jabber import jid, xmlstream 30 from twisted.words.protocols.jabber import jid, xmlstream
32 from twisted.words.xish import domish 31 from twisted.words.xish import domish
33 32
34 from twisted.internet import reactor 33 from twisted.internet import reactor
222 info(_("already connected !")) 221 info(_("already connected !"))
223 return defer.succeed("None") 222 return defer.succeed("None")
224 223
225 def afterMemoryInit(ignore): 224 def afterMemoryInit(ignore):
226 """This part must be called when we have loaded individual parameters from memory""" 225 """This part must be called when we have loaded individual parameters from memory"""
226 try:
227 port = int(self.memory.getParamA("Port", "Connection", profile_key = profile))
228 except ValueError:
229 error(_("Can't parse port value, using default value"))
230 port = 5222
227 current = self.profiles[profile] = xmpp.SatXMPPClient(self, profile, 231 current = self.profiles[profile] = xmpp.SatXMPPClient(self, profile,
228 jid.JID(self.memory.getParamA("JabberID", "Connection", profile_key = profile), profile), 232 jid.JID(self.memory.getParamA("JabberID", "Connection", profile_key = profile), profile),
229 self.memory.getParamA("Password", "Connection", profile_key = profile), 233 self.memory.getParamA("Password", "Connection", profile_key = profile),
230 self.memory.getParamA("Server", "Connection", profile_key = profile), 5222) 234 self.memory.getParamA("Server", "Connection", profile_key = profile),
235 port)
231 236
232 current.messageProt = xmpp.SatMessageProtocol(self) 237 current.messageProt = xmpp.SatMessageProtocol(self)
233 current.messageProt.setHandlerParent(current) 238 current.messageProt.setHandlerParent(current)
234 239
235 current.roster = xmpp.SatRosterProtocol(self) 240 current.roster = xmpp.SatRosterProtocol(self)