From 8e912648105a134cad090d00cdc37007855b0bc2 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Fri, 8 Oct 2010 19:01:14 -0500 Subject: Removed index writing for better or for worse --- logbot.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'logbot.py') diff --git a/logbot.py b/logbot.py index ea731b4..ae11729 100644 --- a/logbot.py +++ b/logbot.py @@ -187,22 +187,23 @@ class LogBot(SingleServerIRCBot): time = strftime("%H:%M:%S") date = strftime("%Y-%m-%d") if channel: - print "%s> %s %s" % (channel, time, message) + #print "%s> %s %s" % (channel, time, message) channels = [channel] else: # Quit/nick don't have channels - print "%s %s" % (time, message) + #print "%s %s" % (time, message) channels = self.chans - index = os.path.join(self.folder, "index.html") + # Create the log folder if we need to + if not os.path.exists(self.folder): - # Create the log folder if we need to os.mkdir(self.folder) - if not os.path.exists(index): - create_html_file(index, "Logged Channels") - append_to_index(index, index_header % "Logged Channels") - shutil.copy2(self.stylesheet, self.folder) + #index = os.path.join(self.folder, "index.html") + #if not os.path.exists(index): + # create_html_file(index, "Logged Channels") + # append_to_index(index, index_header % "Logged Channels") + # shutil.copy2(self.stylesheet, self.folder) for channel in channels: path = os.path.abspath(os.path.join(self.folder, channel)) @@ -213,18 +214,18 @@ class LogBot(SingleServerIRCBot): if not os.path.exists(os.path.join(path, "stylesheet.css")): shutil.copy2(self.stylesheet, path) - chan_index = os.path.join(path, "index.html") + #chan_index = os.path.join(path, "index.html") path = os.path.join(path, date+".html") if not os.path.exists(path): - create_html_file(chan_index, "%s | Logs" % channel) - append_to_index(chan_index, index_header % "%s | Logs" % channel) + #create_html_file(chan_index, "%s | Logs" % channel) + #append_to_index(chan_index, index_header % "%s | Logs" % channel) - append_to_index(index, "%s" % \ - (channel[1:]+"/index.html", channel)) + #append_to_index(index, "%s" % \ + # (channel[1:]+"/index.html", channel)) create_html_file(path, "%s | Logs for %s" % (channel, date)) - append_to_index(chan_index, "%s" % \ - (date+".html", date)) + #append_to_index(chan_index, "%s" % \ + # (date+".html", date)) str = "[%s] %s" % \ (time, time, time, message) -- cgit v1.2.3