translator: Add Python 3 support (see issue #2856)

This also fixes incorrect translation of types in capi header comments.
This commit is contained in:
Marshall Greenblatt
2020-01-09 22:22:11 +02:00
parent dbc479e490
commit 1b85022c58
17 changed files with 97 additions and 72 deletions

View File

@ -6,6 +6,8 @@
A simple utility function to merge pack resource files into a single resource file.
"""
from __future__ import absolute_import
from __future__ import print_function
from date_util import *
from file_util import *
import os
@ -114,7 +116,7 @@ def MakeFile(output, input):
result = result.replace('$YEAR$', get_year())
# add the guard string
filename = os.path.split(output)[1]
guard = 'CEF_INCLUDE_' + string.upper(filename.replace('.', '_')) + '_'
guard = 'CEF_INCLUDE_' + filename.replace('.', '_').upper() + '_'
result = result.replace('$GUARD$', guard)
if path_exists(output):
@ -131,8 +133,8 @@ def MakeFile(output, input):
def main(argv):
if len(argv) < 3:
print("Usage:\n %s <output_filename> <input_file1> [input_file2] ... " %
argv[0])
print(("Usage:\n %s <output_filename> <input_file1> [input_file2] ... " %
argv[0]))
sys.exit(-1)
MakeFile(argv[1], argv[2:])