[damned-lies] Ensure DocFormat.source_files return a list



commit c9ace86ad9fa2b79d45511f917cec942560e2fe6
Author: Claude Paroz <claude 2xlibre net>
Date:   Fri Jun 1 16:50:56 2018 +0200

    Ensure DocFormat.source_files return a list

 stats/utils.py | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/stats/utils.py b/stats/utils.py
index 5c34d0bd..70a9ee6f 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -52,6 +52,7 @@ class DocFormat:
     xml2po_regex = re.compile("^msgid \"@@image: \'(?P<path>[^\']*)\'; md5=(?P<hash>[^\"]*)\"")
 
     def __init__(self, makefile):
+        # makefile is a MakefileWrapper (or subclass) instance)
         self.makefile = makefile
         doc_id = makefile.read_variable("HELP_ID", "yelp.project_id")
         uses_itstool = doc_id is not None or isinstance(makefile, MesonfileWrapper)
@@ -73,6 +74,8 @@ class DocFormat:
         if not sources and self.format == 'mallard':
             # Fallback to directory listing
             return [f for f in self.list_C_files() if f.suffix == '.page']
+        elif sources is None:
+            return []
         if isinstance(sources, str):
             sources = sources.split()
         return [Path('C', src) for src in sources if src not in ('', '$(NULL)')]


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