[damned-lies] Improved meson reading and add source_list fallback for docbook docs



commit a1669dd84b38d10235944f79814fa8734b8b188b
Author: Claude Paroz <claude 2xlibre net>
Date:   Mon Sep 23 08:43:22 2019 +0200

    Improved meson reading and add source_list fallback for docbook docs

 stats/utils.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/stats/utils.py b/stats/utils.py
index 6332ef0f..2c0d47a3 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -103,9 +103,10 @@ class DocFormat:
                     )
 
         source_list = self.makefile.read_variable(self.include_var)
-        if not source_list and self.format == 'mallard':
+        if not source_list:
+            suffix = '.page' if self.format == 'mallard' else '.xml'
             # Fallback to directory listing
-            return [f for f in self.list_C_files() if f.suffix == '.page']
+            return [f for f in self.list_C_files() if f.suffix == suffix]
         if isinstance(source_list, str):
             sources += source_list.split()
         elif source_list:
@@ -232,14 +233,16 @@ class MakefileWrapper:
 class MesonfileWrapper(MakefileWrapper):
     i18n_gettext_kwargs = {'po_dir', 'data_dirs', 'type', 'languages', 'args', 'preset'}
     gnome_yelp_kwargs= {'sources', 'media', 'symlink_media', 'languages'}
+    ignorable_kwargs = {'install_dir'}
     readable = True
 
     @cached_property
     def content(self):
         content = super().content
         # Here be dragons: Try to make meson content look like Python
+        possible_kwargs = list(self.i18n_gettext_kwargs | self.gnome_yelp_kwargs | self.ignorable_kwargs)
         content = re.sub(
-            r'(' + '|'.join(list(self.i18n_gettext_kwargs | self.gnome_yelp_kwargs)) + ') ?:',
+            r'(' + '|'.join(possible_kwargs) + ') ?:',
             r'\1=',
             content
         )


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