Removed index writing for better or for worse

This commit is contained in:
Chris Oliver 2010-10-08 19:01:14 -05:00
parent a951fd8e9f
commit 8e91264810
2 changed files with 17 additions and 16 deletions

View file

@ -2,7 +2,7 @@
server = irc.freenode.net server = irc.freenode.net
port = 6667 port = 6667
server_password = password server_password = password
channels = #excid3 channels = #keryx,#excid3
nick = Timber nick = Timber
nick_password = password nick_password = password

View file

@ -187,22 +187,23 @@ class LogBot(SingleServerIRCBot):
time = strftime("%H:%M:%S") time = strftime("%H:%M:%S")
date = strftime("%Y-%m-%d") date = strftime("%Y-%m-%d")
if channel: if channel:
print "%s> %s %s" % (channel, time, message) #print "%s> %s %s" % (channel, time, message)
channels = [channel] channels = [channel]
else: else:
# Quit/nick don't have channels # Quit/nick don't have channels
print "%s %s" % (time, message) #print "%s %s" % (time, message)
channels = self.chans 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): if not os.path.exists(self.folder):
# Create the log folder if we need to
os.mkdir(self.folder) os.mkdir(self.folder)
if not os.path.exists(index): #index = os.path.join(self.folder, "index.html")
create_html_file(index, "Logged Channels") #if not os.path.exists(index):
append_to_index(index, index_header % "Logged Channels") # create_html_file(index, "Logged Channels")
shutil.copy2(self.stylesheet, self.folder) # append_to_index(index, index_header % "Logged Channels")
# shutil.copy2(self.stylesheet, self.folder)
for channel in channels: for channel in channels:
path = os.path.abspath(os.path.join(self.folder, channel)) 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")): if not os.path.exists(os.path.join(path, "stylesheet.css")):
shutil.copy2(self.stylesheet, path) 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") path = os.path.join(path, date+".html")
if not os.path.exists(path): if not os.path.exists(path):
create_html_file(chan_index, "%s | Logs" % channel) #create_html_file(chan_index, "%s | Logs" % channel)
append_to_index(chan_index, index_header % "%s | Logs" % channel) #append_to_index(chan_index, index_header % "%s | Logs" % channel)
append_to_index(index, "<a href=\"%%23%s\">%s</a>" % \ #append_to_index(index, "<a href=\"%%23%s\">%s</a>" % \
(channel[1:]+"/index.html", channel)) # (channel[1:]+"/index.html", channel))
create_html_file(path, "%s | Logs for %s" % (channel, date)) create_html_file(path, "%s | Logs for %s" % (channel, date))
append_to_index(chan_index, "<a href=\"%s\">%s</a>" % \ #append_to_index(chan_index, "<a href=\"%s\">%s</a>" % \
(date+".html", date)) # (date+".html", date))
str = "<a href=\"#%s\" name=\"%s\" class=\"time\">[%s]</a> %s" % \ str = "<a href=\"#%s\" name=\"%s\" class=\"time\">[%s]</a> %s" % \
(time, time, time, message) (time, time, time, message)