From 3103091bf0921c23c7d6a49eab1b610f726bfb31 Mon Sep 17 00:00:00 2001 From: nanotube Date: Wed, 10 Jan 2007 06:57:27 +0000 Subject: [PATCH] fix bug where we forget to change back to the original directory after zipping logs, thus preventing control panel from opening. --- logwriter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/logwriter.py b/logwriter.py index cedb914..4249fd4 100644 --- a/logwriter.py +++ b/logwriter.py @@ -181,7 +181,9 @@ class LogWriter: zipFileTime = time.strftime("%Y%m%d_%H%M%S") zipFileRawTime = time.time() zipFileName = re.sub(r"\[date\]", zipFileTime, zipFilePattern) - + + # have to change to the dir so we dont get extra dir hierarchy in the zipfile + originalDir = os.getcwd() os.chdir(self.settings['General']['Log Directory']) myzip = zipfile.ZipFile(zipFileName, "w", zipfile.ZIP_DEFLATED) @@ -204,6 +206,9 @@ class LogWriter: ziplog.write(zipFileName) ziplog.close() + # chdir back + os.chdir(originalDir) + #now we can delete all the logs that have not been modified since we made the zip. self.DeleteOldLogs(zipFileRawTime) -- 2.45.1