diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2003-12-02 15:39:28 +0300 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2003-12-02 15:39:28 +0300 |
commit | 11f74c9e30506e3ea6b3c464f0c1d1a23f5052bf (patch) | |
tree | 2b4eab1d8a6035da02524dcd18f8f03a1112f97a /core | |
parent | fd9c01fc4f4df48e4369587eb1b89d19a169eb2b (diff) |
improvements, status messages in chat window
Diffstat (limited to 'core')
-rw-r--r-- | core/core.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/core.py b/core/core.py index dab503896..fb04a5734 100644 --- a/core/core.py +++ b/core/core.py @@ -78,11 +78,11 @@ class GajimCore: log.debug("unsubscribe request from %s" % who) elif type == 'unsubscribed': log.debug("we are now unsubscribed to %s" % who) - # END presenceCB def disconnectedCB(self, con): log.debug("disconnectedCB") + self.con.disconnect() # END disconenctedCB def connect(self, account): @@ -95,14 +95,15 @@ class GajimCore: try: self.con.connect() except IOError, e: - log.debug("Couldn't connect to %s" % e) - sys.exit(0) + log.debug("Couldn't connect to %s %s" % (hostname, e)) + return 0 else: log.debug("Connected to server") self.con.setMessageHandler(self.messageCB) self.con.setPresenceHandler(self.presenceCB) self.con.setDisconnectHandler(self.disconnectedCB) + #BUG in jabberpy library : if hostname is wrong : "boucle" if self.con.auth(name, password, ressource): self.con.requestRoster() roster = self.con.getRoster().getRaw() @@ -112,7 +113,8 @@ class GajimCore: self.con.sendInitPresence() self.connected = 1 else: - sys.exit(1) + log.debug("Couldn't authentificate to %s" % hostname) + return 0 # END connect def mainLoop(self): |