[damned-lies] Pass env variables from get_xgettext_command
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Pass env variables from get_xgettext_command
- Date: Mon, 26 Mar 2018 17:11:09 +0000 (UTC)
commit bcb67dfee36993aefe6103d6154d9cb20ed51b5a
Author: Claude Paroz <claude 2xlibre net>
Date: Mon Mar 26 19:10:13 2018 +0200
Pass env variables from get_xgettext_command
Fixes bug #794702.
stats/models.py | 4 ++--
stats/tests/tests.py | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index a0ae524..494ead8 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -846,7 +846,7 @@ class Domain(models.Model):
elif self.pot_method == GETTEXT_METHOD or (
current_branch.uses_meson and not self.pot_method):
- pot_command = self.get_xgettext_command(current_branch)
+ pot_command, env = self.get_xgettext_command(current_branch)
elif self.pot_method == INTLTOOL_METHOD or not self.pot_method:
# fallback is intltool
@@ -935,7 +935,7 @@ class Domain(models.Model):
bugs_url = self.module.get_bugs_enter_url()
if bugs_url:
pot_command.extend(['--msgid-bugs-address', bugs_url])
- return pot_command
+ return pot_command, env
def get_linguas(self, base_path):
""" Return a linguas dict like this: {'langs':['lang1', lang2], 'error':"Error"} """
diff --git a/stats/tests/tests.py b/stats/tests/tests.py
index 57bc56c..64282b6 100644
--- a/stats/tests/tests.py
+++ b/stats/tests/tests.py
@@ -122,10 +122,12 @@ class ModuleTestCase(TestCase):
domain = self.branch.get_domains()['po']
self.assertEqual(
domain.get_xgettext_command(self.branch),
- ['xgettext', '--files-from', 'POTFILES.in', '--directory',
+ (['xgettext', '--files-from', 'POTFILES.in', '--directory',
'/home/claude/www/damned-lies/cvs/git/gnome-hello', '--from-code', 'utf-8',
'--add-comments', '--output', 'gnome-hello.pot', '--msgid-bugs-address',
- 'https://bugzilla.gnome.org/enter_bug.cgi?product=test&keywords=I18N+L10N&component=test']
+ 'https://bugzilla.gnome.org/enter_bug.cgi?product=test&keywords=I18N+L10N&component=test'],
+ {'GETTEXTDATADIRS': os.path.dirname(utils.ITS_DATA_DIR)}
+ )
)
@test_scratchdir
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]