[damned-lies] Fixed shell pot generation when pot name is non standard



commit 421ad53e575bc1e2dd162215c76da6dc4bcb64ae
Author: Claude Paroz <claude 2xlibre net>
Date:   Mon Jun 25 18:24:49 2018 +0200

    Fixed shell pot generation when pot name is non standard
    
    Refs #84.

 stats/models.py      |  2 +-
 stats/tests/tests.py | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/stats/models.py b/stats/models.py
index 7b7db32b..0e81e377 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -882,7 +882,7 @@ class Domain(models.Model):
                         'output': force_text(errs)
                     }),
                 )
-            if not potfile.exists() and output:
+            if not potfile.exists():
                 # Try to get POT file from command output, with path relative to checkout root
                 m = re.search('([\w/-]*\.pot)', output)
                 if m:
diff --git a/stats/tests/tests.py b/stats/tests/tests.py
index fe9ac9fe..a4abbaa9 100644
--- a/stats/tests/tests.py
+++ b/stats/tests/tests.py
@@ -511,6 +511,16 @@ class DomainTests(TestCase):
         self.addCleanup(os.remove, str(potfile))
         self.assertTrue(potfile.exists())
 
+    def test_shell_pot(self):
+        dom = Domain.objects.create(
+            module=self.mod, name='shell-po', dtype='ui',
+            pot_method='shell',
+            pot_params='touch some.pot'
+        )
+        potfile, errs = dom.generate_pot_file(self.branch)
+        self.addCleanup(os.remove, str(potfile))
+        self.assertTrue(potfile.exists())
+
     @skipUnless(has_translate_subtitle_support, "This test needs translate-toolkit subtitles support.")
     def test_subtitles_pot(self):
         dom = Domain.objects.create(


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