comparison start_bots_from_xml_config.py @ 21:801160b4136f

Introduced a bridge's "say" attribute to offer more flexibility in what the bot says. Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Thu, 20 Aug 2009 15:17:20 +0200
parents c1b84196c100
children bfa32b017fc9
comparison
equal deleted inserted replaced
20:08cde283621a 21:801160b4136f
52 bot_ = bot(bot_el.getAttribute('jid'), bot_el.getAttribute('password'), bot_el.getAttribute('nickname'), debug=debug) 52 bot_ = bot(bot_el.getAttribute('jid'), bot_el.getAttribute('password'), bot_el.getAttribute('nickname'), debug=debug)
53 bots.append(bot_) 53 bots.append(bot_)
54 for bridge_el in bot_el.getElementsByTagName('bridge'): 54 for bridge_el in bot_el.getElementsByTagName('bridge'):
55 xmpp_room = bridge_el.getElementsByTagName('xmpp-room')[0] 55 xmpp_room = bridge_el.getElementsByTagName('xmpp-room')[0]
56 irc = bridge_el.getElementsByTagName('irc')[0] 56 irc = bridge_el.getElementsByTagName('irc')[0]
57 say_participants_list = True 57 say_level = 'all'
58 if bridge_el.hasAttribute('say_participants_list'): 58 if bridge_el.hasAttribute('say_level'):
59 if bridge_el.getAttribute('say_participants_list') == 'false': 59 say_level = bridge_el.getAttribute('say_level')
60 say_participants_list = False
61 if bridge_el.hasAttribute('mode'): 60 if bridge_el.hasAttribute('mode'):
62 mode = bridge_el.getAttribute('mode') 61 mode = bridge_el.getAttribute('mode')
63 else: 62 else:
64 mode = 'normal' 63 mode = 'normal'
65 bridge_ = bot_.new_bridge(xmpp_room.getAttribute('jid'), irc.getAttribute('chan'), irc.getAttribute('server'), mode, say_participants_list) 64 bridge_ = bot_.new_bridge(xmpp_room.getAttribute('jid'), irc.getAttribute('chan'), irc.getAttribute('server'), mode, say_level)
66 65
67 66
68 while True: 67 while True:
69 sleep(1) 68 sleep(1)
70 except: 69 except: