[damned-lies] Fixed the pot_command logic in generate_pot_file for non-empty pot_method



commit 9a8c7ec27f4349e8a5fc81ac2067b8f2f1c4462f
Author: Claude Paroz <claude 2xlibre net>
Date:   Mon Mar 26 09:52:33 2018 +0200

    Fixed the pot_command logic in generate_pot_file for non-empty pot_method
    
    Fixes bug #794683.

 stats/models.py    |   10 ++++++----
 stats/utils.py     |    2 +-
 vertimus/models.py |    2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index be6e9b3..4df5fdb 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -814,14 +814,12 @@ class Domain(models.Model):
         """ Return the pot file generated (in the checkout tree), and the error if any """
 
         vcs_path = current_branch.co_path() / self.directory
-        pot_command = self.pot_method
         env = None
         podir = vcs_path
 
-        if current_branch.uses_meson or self.pot_method == GETTEXT_METHOD:
-            pot_command = self.get_xgettext_command(current_branch)
+        pot_command = self.pot_method
 
-        elif self.module.name == 'damned-lies':
+        if self.module.name == 'damned-lies':
             # Special case for d-l, pot file should be generated from running instance dir
             pot_command = ''
             call_command('update-trans', 'en')
@@ -841,6 +839,10 @@ class Domain(models.Model):
             pot_command = None
             status = utils.STATUS_OK
 
+        elif self.pot_method == GETTEXT_METHOD or (
+                current_branch.uses_meson and not self.pot_method):
+            pot_command = self.get_xgettext_command(current_branch)
+
         elif not self.pot_method:  # fallback is intltool
             pot_command = ['intltool-update', '-g', self.potbase(), '-p']
             bugs_url = self.module.get_bugs_enter_url()
diff --git a/stats/utils.py b/stats/utils.py
index 8d5350d..61e6457 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -436,7 +436,7 @@ def generate_doc_pot_file(vcs_path, potbase, moduleid):
                                 'cmd': " ".join([c.replace(settings.SCRATCHDIR, "&lt;scratchdir&gt;") for c 
in command]),
                                 'output': errs})
                      )
-        potfile = ""
+        return "", errors, doc_format
 
     if not potfile.exists():
         return "", errors, doc_format
diff --git a/vertimus/models.py b/vertimus/models.py
index 9e3ed16..ab23cca 100644
--- a/vertimus/models.py
+++ b/vertimus/models.py
@@ -497,7 +497,7 @@ class Action(ActionAbstract):
             self.save()
             return # post_save will call merge_file_with_pot again
         merged_path = self.merged_file.path
-        command = ['msgmerge', '--previous', '-o', merged_path, self.file.path, pot_file]
+        command = ['msgmerge', '--previous', '-o', merged_path, self.file.path, str(pot_file)]
         run_shell_command(command)
         # If uploaded file is reduced, run po_grep *after* merge
         if is_po_reduced(self.file.path):


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