]> git.0d.be Git - pige-extractor.git/commitdiff
Change the way files are listed, to work with cwd
authorFrédéric Péters <fpeters@0d.be>
Mon, 12 Apr 2010 10:39:16 +0000 (12:39 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sun, 15 May 2016 12:03:17 +0000 (14:03 +0200)
download.cgi

index ef37b988905e060c05f38ad60a839255ec1747f5..e271d0c75731946fc939f733307481821cbd4e76 100755 (executable)
@@ -83,14 +83,13 @@ os.chdir(BASE_DIR)
 def get_filenames():
     path = start.strftime(PATH_LAYOUT)
     if not path:
-        path = '.'
-    filenames = [os.path.join(path, x) for x in os.listdir(path)]
-    if end.hour < start.hour:
-        path = end.strftime(PATH_LAYOUT)
-        if not path:
-            path = '.'
-        if os.path.exists(path):
-            filenames.extend([os.path.join(path, x) for x in os.listdir(path)])
+        filenames = [x for x in os.listdir('.')]
+    else:
+        filenames = [os.path.join(path, x) for x in os.listdir(path)]
+        if end.hour < start.hour:
+            path = end.strftime(PATH_LAYOUT)
+            if os.path.exists(path):
+                filenames.extend([os.path.join(path, x) for x in os.listdir(path)])
     filenames.sort()
 
     filenames = [x for x in filenames if