Mercurial > xib
comparison bot.py @ 33:cb6771a8c3ca
Fixed a dumb error.
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sat, 22 Aug 2009 16:55:17 +0200 |
parents | 8aa261545662 |
children | 57d0e66378b0 |
comparison
equal
deleted
inserted
replaced
32:8aa261545662 | 33:cb6771a8c3ca |
---|---|
89 except (xml.parsers.expat.ExpatError, xmpp.protocol.XMLNotWellFormed): | 89 except (xml.parsers.expat.ExpatError, xmpp.protocol.XMLNotWellFormed): |
90 self.error('=> Debug: received invalid stanza', debug=True) | 90 self.error('=> Debug: received invalid stanza', debug=True) |
91 continue | 91 continue |
92 | 92 |
93 | 93 |
94 def _xmpp_disconnect_handler(self, xmpp_c): | 94 def _xmpp_disconnect_handler(xmpp_c): |
95 xmpp_c.reconnectAndReauth() | 95 xmpp_c.reconnectAndReauth() |
96 return | 96 return |
97 | 97 |
98 | 98 |
99 def _xmpp_presence_handler(self, dispatcher, presence): | 99 def _xmpp_presence_handler(self, dispatcher, presence): |
439 c.connect() | 439 c.connect() |
440 c.auth(self.bare_jid.getNode(), self.password) | 440 c.auth(self.bare_jid.getNode(), self.password) |
441 c.RegisterHandler('presence', self._xmpp_presence_handler) | 441 c.RegisterHandler('presence', self._xmpp_presence_handler) |
442 c.RegisterHandler('iq', self._xmpp_iq_handler) | 442 c.RegisterHandler('iq', self._xmpp_iq_handler) |
443 c.RegisterHandler('message', self._xmpp_message_handler) | 443 c.RegisterHandler('message', self._xmpp_message_handler) |
444 c.RegisterDisconnectHandler(self._xmpp_disconnect_handler(c)) | 444 c.RegisterDisconnectHandler(self.__class__._xmpp_disconnect_handler) |
445 c.sendInitPresence() | 445 c.sendInitPresence() |
446 c.lock.release() | 446 c.lock.release() |
447 return c | 447 return c |
448 | 448 |
449 | 449 |