summaryrefslogtreecommitdiff
path: root/logbot.py
diff options
context:
space:
mode:
authorFilip H.F. "FiXato" Slagter <fixato@gmail.com>2012-06-12 01:53:04 +0200
committerFilip H.F. "FiXato" Slagter <fixato@gmail.com>2012-06-12 01:53:04 +0200
commit7af5c60e2afbf9df4fff8f8dcc9478901bab6462 (patch)
treed2f9999cfebb9fb37e7cf1125c0bf8af8c40ba2a /logbot.py
parent48048ea28f862e766a1efc2ce773e903d88e0a63 (diff)
downloadlogbot-7af5c60e2afbf9df4fff8f8dcc9478901bab6462.tar.xz
Force lowercase channel keys
Force the channel keys of the CHANNEL_LOCATIONS_FILE config to lowercase.
Diffstat (limited to 'logbot.py')
-rwxr-xr-xlogbot.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/logbot.py b/logbot.py
index 4450926..0e465da 100755
--- a/logbot.py
+++ b/logbot.py
@@ -378,15 +378,12 @@ class Logbot(SingleServerIRCBot):
self.write_event("topic", e)
# Loads the channel - timezone-location pairs from the CHANNEL_LOCATIONS_FILE
- # Each line is expected to have the channelname and (pytz) TimeZone location separated by a space
- # Example:
- # #excid3 UTC
- # #Netherlands Europe/Amsterdam
+ # See the README for details and example
def load_channel_locations(self):
self.channel_locations = {}
if os.path.exists(CHANNEL_LOCATIONS_FILE):
f = open(CHANNEL_LOCATIONS_FILE, 'r')
- self.channel_locations = dict([line.split() for line in f.readlines()])
+ self.channel_locations = dict((k.lower(), v) for k, v in dict([line.split(None,1) for line in f.readlines()]).iteritems())
def connect_ftp():
print "Using FTP %s..." % (FTP_SERVER)