diff roundup/scripts/roundup_gettext.py @ 5376:64b05e24dbd8

Python 3 preparation: convert print to a function. Tool-assisted patch. It is possible that some "from __future__ import print_function" are not in fact needed, if a file only uses print() with a single string as an argument and so would work fine in Python 2 without that import.
author Joseph Myers <jsm@polyomino.org.uk>
date Tue, 24 Jul 2018 09:54:52 +0000
parents 86ef4ab17dc5
children 32a5a54536b5
line wrap: on
line diff
--- a/roundup/scripts/roundup_gettext.py	Sat Jul 21 23:07:16 2018 +1000
+++ b/roundup/scripts/roundup_gettext.py	Tue Jul 24 09:54:52 2018 +0000
@@ -4,6 +4,7 @@
 
 """Extract translatable strings from tracker templates"""
 
+from __future__ import print_function
 import os
 import sys
 
@@ -30,7 +31,7 @@
 def run():
     # return unless command line arguments contain single directory path
     if (len(sys.argv) != 2) or (sys.argv[1] in ("-h", "--help")):
-        print _("Usage: %(program)s <tracker home>") % {"program": sys.argv[0]}
+        print(_("Usage: %(program)s <tracker home>") % {"program": sys.argv[0]})
         return
     # collect file paths of html templates
     home = os.path.abspath(sys.argv[1])
@@ -45,7 +46,7 @@
         htmlfiles = []
     # return if no html files found
     if not htmlfiles:
-        print _("No tracker templates found in directory %s") % home
+        print(_("No tracker templates found in directory %s") % home)
         return
     # change to locale dir to have relative source references
     locale = os.path.join(home, "locale")

Roundup Issue Tracker: http://roundup-tracker.org/