[damned-lies] Restricting directory listing fallback



commit 3ecb416d4869727634df9e96392241d65d006db0
Author: Claude Paroz <claude 2xlibre net>
Date:   Thu Jan 16 10:06:08 2014 +0100

    Restricting directory listing fallback

 stats/utils.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/stats/utils.py b/stats/utils.py
index 407c6f7..c391ad0 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -234,9 +234,10 @@ def generate_doc_pot_file(vcs_path, potbase, moduleid):
     includes = read_makefile_variable([vcs_path], doc_format.include_var)
     if includes:
         files.extend(filter(lambda x:x not in ("", "$(NULL)"), includes.split()))
-    else:
+    elif includes is None and doc_format.format == "mallard":
         # fallback to directory listing
-        files = [f for f in os.listdir(os.path.join(vcs_path, "C")) if f.endswith(".page")]
+        files.extend([f for f in os.listdir(os.path.join(vcs_path, "C"))
+                      if f not in files and f.endswith(".page")])
 
     files = " ".join([os.path.join("C", f) for f in files])
     potfile = os.path.join(vcs_path, "C", potbase + ".pot")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]