summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-02-23 21:12:49 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-02-23 21:12:49 +0100
commit81f8318dd5aea47016f5b932c296084969891327 (patch)
treeb3420299dfc4073dfe488f0f82a6fa1f461c65df
parent7a7cce4fae7d530e14d7e107555b3fa113609e73 (diff)
Use 'server/'-prefix in the config file.
Some minor import cleanup.
-rwxr-xr-xfot.py5
1 files 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)