1 class ConfigChannel(object):
3 def __init__(self, name, password=''):
5 self.password = password
7 class ConfigServer(object):
9 def __init__(self, host, port=6667):
10 """Create a server for the config, which is part of a network.
13 host: The host to connect to for the server
14 port: The port to connect to on the host
19 class ConfigNetwork(object):
21 def __init__(self, statefile, servers, channels, nickname, realname,
22 nickservpw=None, autocommands=[], reconnect=None, rejoin=None):
23 """Create a network for the config.
26 statefile: The name of the file to load/save state
27 servers: A list of ConfigServer objects
28 channels: A list of ConfigChannel objects
29 nickname: A string to use as a nickname
30 realname: A string to use as a real name
31 nickservpw: A string password for the nickserv service, if available
32 autocommands: A list of strings, which are commands to send to the server
34 reconnect: An optional value to specify the number of seconds to wait
35 before reconnecting. If not set, it will not reconnect.
36 rejoin: An optional value to specify the number of seconds to wait
37 before rejoining a channel. If not set, it will not rejoin.
39 self.statefile = statefile
40 self.servers = servers
41 self.channels = channels
42 self.nickname = nickname
43 self.realname = realname
44 self.nickservpw = nickservpw
45 self.autocommands = autocommands
46 self.reconnect_delay = reconnect
47 self.rejoin_delay = rejoin
50 """Configuration options for the brick bot."""
54 statefile='bricker-oftc.state',
56 ConfigServer('irc.oftc.net'),
59 ConfigChannel('#bling'),
62 realname='brickerbot',
63 nickservpw='_br1ck3r_1z_m1n3_',