comparison bridge.py @ 150:e0eea72ea493

new bridge attribute "irc_connection_interval" (in seconds) Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sun, 17 Jan 2010 21:14:23 +0100
parents 38eb220142a1
children 17305e57f71d
comparison
equal deleted inserted replaced
149:332bb2e8e71e 150:e0eea72ea493
41 41
42 42
43 class NoSuchParticipantException(Exception): pass 43 class NoSuchParticipantException(Exception): pass
44 44
45 45
46 def __init__(self, owner_bot, xmpp_room_jid, irc_room, irc_server, mode, say_level, irc_port=6667): 46 def __init__(self, owner_bot, xmpp_room_jid, irc_room, irc_server, mode, say_level, irc_port=6667, irc_connection_interval=1):
47 """Create a new bridge.""" 47 """Create a new bridge."""
48 self.bot = owner_bot 48 self.bot = owner_bot
49 self.irc_server = irc_server 49 self.irc_server = irc_server
50 self.irc_port = irc_port 50 self.irc_port = irc_port
51 self.irc_room = irc_room.lower() 51 self.irc_room = irc_room.lower()
52 self.irc_connection_interval = irc_connection_interval
52 self.xmpp_room_jid = xmpp_room_jid 53 self.xmpp_room_jid = xmpp_room_jid
53 if hasattr(self.__class__, '_'+say_level): 54 if hasattr(self.__class__, '_'+say_level):
54 self.say_level = getattr(self.__class__, '_'+say_level) 55 self.say_level = getattr(self.__class__, '_'+say_level)
55 else: 56 else:
56 raise Exception('[Error] "'+say_level+'" is not a correct value for a bridge\'s "say_level" attribute') 57 raise Exception('[Error] "'+say_level+'" is not a correct value for a bridge\'s "say_level" attribute')