index : logbot | |
Archlinux32 log bot | gitolite user |
summaryrefslogtreecommitdiff |
author | Filip H.F. "FiXato" Slagter <fixato@gmail.com> | 2012-06-09 01:17:08 +0200 |
---|---|---|
committer | Filip H.F. "FiXato" Slagter <fixato@gmail.com> | 2012-06-09 01:29:07 +0200 |
commit | 930cd6bc11ffd05f92889232051ad851ae4892db (patch) | |
tree | 5f19971d2a693f30bcbb6c25a3a805d59e36a0c7 | |
parent | 3b878cc2ccaa3bec6dcd0ecf545baae0e3cce800 (diff) |
-rwxr-xr-x | logbot.py | 7 |
@@ -249,6 +249,9 @@ class Logbot(SingleServerIRCBot): def append_log_msg(self, channel, msg): print "%s >>> %s" % (channel, msg) + #Make sure the channel is always lowercase to prevent logs with other capitalisations to be created + channel_title = channel + channel = channel.lower() # Create the channel path if necessary chan_path = "%s/%s" % (LOG_FOLDER, channel) @@ -256,7 +259,7 @@ class Logbot(SingleServerIRCBot): os.makedirs(chan_path) # Create channel index - write_string("%s/index.html" % chan_path, html_header.replace("%title%", "%s | Logs" % channel)) + write_string("%s/index.html" % chan_path, html_header.replace("%title%", "%s | Logs" % channel_title)) # Append channel to log index append_line("%s/index.html" % LOG_FOLDER, '<a href="%s/index.html">%s</a>' % (channel.replace("#", "%23"), channel)) @@ -268,7 +271,7 @@ class Logbot(SingleServerIRCBot): # Create the log date index if it doesnt exist if not os.path.exists(log_path): - write_string(log_path, html_header.replace("%title%", "%s | Logs for %s" % (channel, date))) + write_string(log_path, html_header.replace("%title%", "%s | Logs for %s" % (channel_title, date))) # Append date log append_line("%s/index.html" % chan_path, '<a href="%s.html">%s</a>' % (date, date)) |