diff options
Diffstat (limited to 'src/util/xmlpool/gen_xmlpool.py')
-rw-r--r-- | src/util/xmlpool/gen_xmlpool.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/util/xmlpool/gen_xmlpool.py b/src/util/xmlpool/gen_xmlpool.py index eb68a65174b..8336e0f9523 100644 --- a/src/util/xmlpool/gen_xmlpool.py +++ b/src/util/xmlpool/gen_xmlpool.py @@ -7,6 +7,8 @@ # `{localedir}/{language}/LC_MESSAGES/options.mo`. # +from __future__ import print_function + import sys import gettext import re @@ -130,16 +132,16 @@ def expandMatches (matches, translations, end=None): # non-ascii unicode chars in the original English descriptions. text = escapeCString (trans.ugettext (unicode (expandCString ( matches[0].expand (r'\5')), "utf-8"))).encode("utf-8") - print matches[0].expand (r'\1' + lang + r'\3"' + text + r'"\7') + suffix + print(matches[0].expand (r'\1' + lang + r'\3"' + text + r'"\7') + suffix) # Expand any subsequent enum lines for match in matches[1:]: text = escapeCString (trans.ugettext (unicode (expandCString ( match.expand (r'\3')), "utf-8"))).encode("utf-8") - print match.expand (r'\1"' + text + r'"\5') + print(match.expand (r'\1"' + text + r'"\5')) # Expand description end if end: - print end, + print(end, end='') # Compile a list of translation classes to all supported languages. # The first translation is always a NullTranslations. @@ -160,10 +162,9 @@ reENUM = re.compile (r'(\s*DRI_CONF_ENUM\s*\([^,]+,\s*)(gettext\s*\(\s*")( reDESC_END = re.compile (r'\s*DRI_CONF_DESC_END') # Print a header -print \ -"/***********************************************************************\n" \ +print("/***********************************************************************\n" \ " *** THIS FILE IS GENERATED AUTOMATICALLY. DON'T EDIT! ***\n" \ -" ***********************************************************************/" +" ***********************************************************************/") # Process the options template and generate options.h with all # translations. @@ -185,7 +186,7 @@ for line in template: continue if reLibintl_h.search (line): # Ignore (comment out) #include <libintl.h> - print "/* %s * commented out by gen_xmlpool.py */" % line + print("/* %s * commented out by gen_xmlpool.py */" % line) continue matchDESC = reDESC .match (line) matchDESC_BEGIN = reDESC_BEGIN.match (line) @@ -196,7 +197,7 @@ for line in template: assert len(descMatches) == 0 descMatches = [matchDESC_BEGIN] else: - print line, + print(line, end='') if len(descMatches) > 0: sys.stderr.write ("Warning: unterminated description at end of file.\n") |