← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~miroslavr256/widelands/bug-1524841 into lp:widelands

 

Miroslav Remák has proposed merging lp:~miroslavr256/widelands/bug-1524841 into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1524841 in widelands: "Translation updates are incomplete"
  https://bugs.launchpad.net/widelands/+bug/1524841

For more details, see:
https://code.launchpad.net/~miroslavr256/widelands/bug-1524841/+merge/286735

This should hopefully fix bug #1524841. Needs testing from someone who can reproduce the bug.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~miroslavr256/widelands/bug-1524841 into lp:widelands.
=== modified file 'utils/buildcat.py'
--- utils/buildcat.py	2016-02-03 09:22:53 +0000
+++ utils/buildcat.py	2016-02-20 15:58:07 +0000
@@ -306,18 +306,25 @@
     and write out the given potfile
     """
     # call xgettext and supply source filenames via stdin
-    gettext_input = subprocess.Popen("xgettext %s --files-from=- --output=%s" % \
-            (XGETTEXTOPTS, potfile), shell=True, stdin=subprocess.PIPE, universal_newlines=True).stdin
+    xgettext = subprocess.Popen("xgettext %s --files-from=- --output=%s" % \
+            (XGETTEXTOPTS, potfile), shell=True, stdin=subprocess.PIPE, universal_newlines=True)
     try:
         for one_pattern in srcfiles:
             # 'normpath' is necessary for windows ('/' vs. '\')
             # 'glob' handles filename wildcards
             for one_file in glob(os.path.normpath(one_pattern)):
-                gettext_input.write(one_file + "\n")
-        return gettext_input.close()
+                xgettext.stdin.write(one_file + "\n")
+        xgettext.stdin.close()
     except IOError as err_msg:
         sys.stderr.write("Failed to call xgettext: %s\n" % err_msg)
-        return -1
+        return False
+    
+    xgettext_status = xgettext.wait()
+    if (xgettext_status != 0):
+        sys.stderr.write("xgettext exited with errorcode %i\n" % xgettext_status)
+        return False
+    
+    return True
 
 
 ##############################################################################
@@ -368,8 +375,7 @@
             potfile = os.path.basename(pot) + '.pot'
             if pot.startswith('widelands'):
                 # This catalogs can be built with xgettext
-                do_compile_src(potfile , srcfiles )
-                succ = True
+                succ = do_compile_src(potfile , srcfiles )
             else:
                 succ = do_compile(potfile, srcfiles)
 


Follow ups