comparison irclib.py @ 218:ca22fdea1c17

(irclib) minor fixes for 9e494bf91d13f165af272b7bef9422a4ea9100eb (auto-reconnection improvement) Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sat, 06 Mar 2010 23:37:35 +0100
parents fb0cf6bf9eab
children 63289aa1dea7
comparison
equal deleted inserted replaced
217:45065f6f674c 218:ca22fdea1c17
290 if self.bot.halt: 290 if self.bot.halt:
291 self.disconnect_all(message='Stopping bot') 291 self.disconnect_all(message='Stopping bot')
292 break 292 break
293 try: 293 try:
294 self.process_once(timeout) 294 self.process_once(timeout)
295 except ServerNotConnectedError: 295 except ServerNotConnectedError as e:
296 c = e.args[1] 296 if len(e.args) > 0:
297 c = e.args[0]
298 else:
299 self.bot.error(say_levels.error, 'Unkonwn exception on IRC thread:\n'+str(e.args))
300 continue
297 if c.real_nickname == self.bot.nickname: 301 if c.real_nickname == self.bot.nickname:
298 self.bot.restart(message='Lost bot IRC connection') 302 self.bot.restart(message='Lost bot IRC connection')
299 else: 303 else:
300 c.disconnect(volontary=True) 304 c.disconnect(volontary=True)
301 c.connect() 305 c.connect()