Mercurial > xib
comparison bot.py @ 171:489c157d9e82
display error when bot creation fails
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Mon, 01 Feb 2010 23:02:50 +0100 |
parents | 0fc24e232997 |
children | 64a0e9636ae6 |
comparison
equal
deleted
inserted
replaced
170:11717d14e22f | 171:489c157d9e82 |
---|---|
36 class Bot(threading.Thread): | 36 class Bot(threading.Thread): |
37 | 37 |
38 def __init__(self, jid, password, nickname, admins_jid=[], error_fd=sys.stderr, debug=False): | 38 def __init__(self, jid, password, nickname, admins_jid=[], error_fd=sys.stderr, debug=False): |
39 threading.Thread.__init__(self) | 39 threading.Thread.__init__(self) |
40 self.halt = False | 40 self.halt = False |
41 self.bridges = [] | |
41 self.bare_jid = xmpp.protocol.JID(jid=jid) | 42 self.bare_jid = xmpp.protocol.JID(jid=jid) |
42 self.bare_jid.setResource('') | 43 self.bare_jid.setResource('') |
43 self.nickname = nickname | 44 self.nickname = nickname |
44 self.password = password | 45 self.password = password |
45 self.error_fd = error_fd | 46 self.error_fd = error_fd |
46 self.debug = debug | 47 self.debug = debug |
47 self.admins_jid = admins_jid | 48 self.admins_jid = admins_jid |
48 self.bridges = [] | |
49 self.xmpp_connections = {} | 49 self.xmpp_connections = {} |
50 self.irc = irclib.IRC() | 50 self.irc = irclib.IRC() |
51 self.irc.bot = self | 51 self.irc.bot = self |
52 self.irc.add_global_handler('all_events', self._irc_event_handler) | 52 self.irc.add_global_handler('all_events', self._irc_event_handler) |
53 self.irc_thread = threading.Thread(target=self.irc.process_forever) | 53 self.irc_thread = threading.Thread(target=self.irc.process_forever) |