[damned-lies] Try to find a generated pot file inside po directory



commit 47b109e5dd50e889f08646e9b18a179607627bea
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue Mar 3 21:03:57 2015 +0100

    Try to find a generated pot file inside po directory

 stats/models.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/stats/models.py b/stats/models.py
index cbeb4b7..3c6de41 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -19,6 +19,7 @@
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 from collections import Counter
+import fnmatch
 import logging
 import os, sys, re
 import threading
@@ -779,6 +780,11 @@ class Domain(models.Model):
             m = re.search('([\w/-]*\.pot)', output)
             if m:
                 potfile = os.path.join(current_branch.co_path(), m.group(0))
+            else:
+                # Try to find .pot file in /po dir
+                for file_ in os.listdir(podir):
+                    if fnmatch.fnmatch(file_, '*.pot'):
+                        potfile = os.path.join(podir, file_)
 
         if status != utils.STATUS_OK or not os.access(potfile, os.R_OK):
             return "", (("error", ugettext_noop("Error regenerating POT file for 
%(file)s:\n<pre>%(cmd)s\n%(output)s</pre>")


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