Fixed bug where if logs folder exists and no index.html exists, the bot will crash

This commit is contained in:
Chris Oliver 2010-02-28 15:48:42 -06:00
parent bc3c1e7344
commit 1a8adb1529

View file

@ -171,6 +171,8 @@ class LogBot(SingleServerIRCBot):
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)