[damned-lies] Moved env definition before potfile command



commit 4b7a83ce9f5cc50a8003e934c836924f9c4ee125
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue Mar 3 20:24:34 2015 +0100

    Moved env definition before potfile command
    
    It's possible that custom pot_method commands actually also use
    intltool-update.

 stats/models.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index 02b3c63..cbeb4b7 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -748,9 +748,7 @@ class Domain(models.Model):
         vcs_path = os.path.join(current_branch.co_path(), self.directory)
         pot_command = self.pot_method
         podir = vcs_path
-        env = None
-        if not self.pot_method: # default is intltool
-            env = {"XGETTEXT_ARGS": "\"--msgid-bugs-address=%s\"" % self.module.get_bugs_enter_url()}
+        if not self.pot_method:  # default is intltool
             pot_command = ['intltool-update', '-g', self.potbase(), '-p']
         elif self.pot_method.startswith(('http://', 'https://')):
             # Get POT from URL and save file locally
@@ -769,6 +767,10 @@ class Domain(models.Model):
             podir = "."
             vcs_path = "./po"
 
+        env = None
+        if 'intltool-update' in pot_command:
+            env = {"XGETTEXT_ARGS": "\"--msgid-bugs-address=%s\"" % self.module.get_bugs_enter_url()}
+
         (status, output, errs) = utils.run_shell_command(pot_command, env=env, cwd=podir)
 
         potfile = os.path.join(vcs_path, self.potbase() + ".pot")


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