[damned-lies] Fallback to glib preset when meson.build file cannot be read



commit c5b777059072d0e15857a1e5e08752539a3ede3f
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue Mar 27 20:56:12 2018 +0200

    Fallback to glib preset when meson.build file cannot be read

 stats/models.py |    2 +-
 stats/utils.py  |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index 494ead8..2bf6e62 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -906,7 +906,7 @@ class Domain(models.Model):
         else:
             makefile = utils.MakefileWrapper.find_file([vcs_path], file_name='meson.build')
             if makefile:
-                if makefile.read_variable('gettext.preset') == 'glib':
+                if makefile.read_variable('gettext.preset') == 'glib' or not makefile.readable:
                     # These args should be kept in sync with
                     # https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/i18n.py#L25
                     pot_command.extend([
diff --git a/stats/utils.py b/stats/utils.py
index 29e4172..29baaa0 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -202,6 +202,7 @@ class MakefileWrapper:
 class MesonfileWrapper(MakefileWrapper):
     i18n_gettext_kwargs = {'po_dir', 'data_dirs', 'type', 'languages', 'args', 'preset'}
     gnome_yelp_kwargs= {'sources', 'media', 'symlink_media', 'languages'}
+    readable = True
 
     @cached_property
     def content(self):
@@ -255,6 +256,7 @@ class MesonfileWrapper(MakefileWrapper):
                 else:
                     break
             except Exception:
+                self.readable = False
                 break
         return catched
 


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