-#! /usr/bin/env python
+#! /usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (C) 2007 Michael Gerz <michael.gerz@teststep.org>
# Copyright (C) 2007 José Matos <jamatos@lyx.org>
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)
# 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):
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)
if __name__ == "__main__":
if lyx_branch:
- branch_tag = "branches/%s" % lyx_branch
+ branch_tag = lyx_branch
else:
- branch_tag = "trunk"
+ branch_tag = "master"
- print """<?php
+ print("""<?php
// The current version
$lyx_version = "%s";
// The branch tag
// The data itself
$podata = array (%s
-)?>""" % (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])))