changeset 385:09d6d11d7043

check if logdir exist before detemining log files
author Bjoern Ricks <bricks@intevation.de>
date Wed, 07 Jul 2010 13:32:28 +0000 (2010-07-07)
parents 43a96d4874d1
children 25d702bb13f9
files treepkg/packager.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/packager.py	Wed Jul 07 10:10:14 2010 +0000
+++ b/treepkg/packager.py	Wed Jul 07 13:32:28 2010 +0000
@@ -325,11 +325,12 @@
 
     def get_log_files(self, logs):
         files = []
-        for f in os.listdir(self.log_dir):
-            if f in logs:
-                f = os.path.join(self.log_dir,f)
-                if os.path.isfile(f):
-                    files.append((self.get_log_title(f),f))
+        if os.path.isdir(self.log_dir):
+            for f in os.listdir(self.log_dir):
+                if f in logs:
+                    f = os.path.join(self.log_dir,f)
+                    if os.path.isfile(f):
+                        files.append((self.get_log_title(f),f))
         return files
         
     def list_log_files(self, logs):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)