X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=po%2Fpostats.py;h=8c5f058642c87acc01096d3129af73a333a3e78a;hb=283b7c0829306a5925afbb945512b85769e8ecd0;hp=29a243eccc5581d0f98f01f141542bd54326c78e;hpb=2db3153417f8f5c020c414f8405a900eec91473c;p=lyx.git diff --git a/po/postats.py b/po/postats.py index 29a243eccc..8c5f058642 100755 --- a/po/postats.py +++ b/po/postats.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/python3 # -*- coding: utf-8 -*- # Copyright (C) 2007 Michael Gerz # Copyright (C) 2007 José Matos @@ -26,6 +26,7 @@ and generates a PHP web page. Invocation: postats.py lyx_version po_files > "pathToWebPages"/i18n.inc """ +from __future__ import print_function # modify this when you change branch # Note that an empty lyx_branch variable (ie svn trunk) @@ -39,7 +40,7 @@ import sys # Reset the locale import locale -locale.setlocale(locale.LC_ALL, 'C') +locale.setlocale(locale.LC_ALL, 'C') os.environ['LC_ALL'] = 'C' def extract_number(line, issues, prop): @@ -93,7 +94,7 @@ def run_msgfmt(pofile): The function runs msgfmt on it and returns corresponding php code. """ if not pofile.endswith('.po'): - print >> sys.stderr, "%s is not a po file" % pofile + print("%s is not a po file" % pofile, file=sys.stderr) sys.exit(1) dirname = os.path.dirname(pofile) @@ -132,7 +133,7 @@ if __name__ == "__main__": branch_tag = "master" - print """""" % (sys.argv[1], branch_tag, ",".join([run_msgfmt(po) for po in sys.argv[2:] if po not in ommitted])) +)?>""" % (sys.argv[1], branch_tag, ",".join([run_msgfmt(po) for po in sys.argv[2:] if po not in ommitted])))