comparison start_bots_from_xml_config.py @ 19:c1b84196c100

Changed format of non-debug error messages, fixed IRC namreply handling, prevented crash when receiving bad XMPP stanza. Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Thu, 20 Aug 2009 13:20:50 +0200
parents 32a35f7eff70
children 801160b4136f
comparison
equal deleted inserted replaced
18:3cdf7bb580da 19:c1b84196c100
29 if len(sys.argv) > 1: 29 if len(sys.argv) > 1:
30 config = parse(sys.argv[1]) 30 config = parse(sys.argv[1])
31 else: 31 else:
32 config = parse('config.xml') 32 config = parse('config.xml')
33 except IOError: 33 except IOError:
34 print 'Error: configuration file is missing or cannot be read' 34 print '[Error] configuration file is missing or cannot be read'
35 quit(1) 35 quit(1)
36 36
37 bots_jids = [] 37 bots_jids = []
38 for bot_el in config.getElementsByTagName('bot'): 38 for bot_el in config.getElementsByTagName('bot'):
39 if bot_el.getAttribute('jid') in bots_jids: 39 if bot_el.getAttribute('jid') in bots_jids:
40 print 'Error: you cannot have two bots using the same JID' 40 print '[Error] you cannot have two bots using the same JID'
41 quit(2) 41 quit(2)
42 bots_jids.append(bot_el.getAttribute('jid')) 42 bots_jids.append(bot_el.getAttribute('jid'))
43 43
44 44
45 try: 45 try: