From 81f8318dd5aea47016f5b932c296084969891327 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 23 Feb 2010 21:12:49 +0100 Subject: Use 'server/'-prefix in the config file. Some minor import cleanup. --- fot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fot.py b/fot.py index c2470cf..c468c19 100755 --- a/fot.py +++ b/fot.py @@ -6,7 +6,7 @@ from twisted.python import log from twisted.protocols.basic import LineReceiver from twisted.manhole.telnet import Shell -import sys, os, traceback, StringIO, md5 +import os from ConfigParser import ConfigParser @@ -105,7 +105,7 @@ class BotFactory(protocol.ReconnectingClientFactory): protocol.ReconnectingClientFactory.clientConnectionLost(self, connector, reason) print 'Starting per-network instances...' -for server in config.sections(): +for server in (server for server in config.sections() if server.startswith('server/')): if not config.has_option(server,'host') or not config.has_option(server, 'port') or not config.has_option(server, 'channels') or config.has_option(server, 'disabled'): continue channels = [] @@ -118,7 +118,6 @@ for server in config.sections(): factory = BotFactory(server, config.get(server, 'nickname')) reactor.connectTCP(config.get(server, 'host'), config.getint(server, 'port'), factory) -# TODO: Fix user/pass loginfactory = login.getManholeFactory(globals(), os.path.expanduser('~/.fot.users')) reactor.listenTCP(3333, loginfactory) -- cgit v1.2.3