From 6be046642290c28c17949022fb66ae02ac21d544 Mon Sep 17 00:00:00 2001 From: aneejit1 Date: Tue, 19 Apr 2022 13:21:52 +0000 Subject: Updates to support Python version 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amendments to the sip source and configuration/build scripts to allow for support under Python version 3. The examples have been updated using "2to3" along with some manual changes to sort out intentation and casting to integer from float. Signed-off-by: aneejit1 Signed-off-by: Slávek Banko --- build.py | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'build.py') diff --git a/build.py b/build.py index fa63bfc..890acad 100644 --- a/build.py +++ b/build.py @@ -37,8 +37,8 @@ import string try: import sip_tqt_config except: - print "Unable to import the sip_tqt_config module. Please make sure you have" - print "SIP-TQt v3.9 or later installed." + print("Unable to import the sip_tqt_config module. Please make sure you have") + print("SIP-TQt v3.9 or later installed.") sys.exit(1) config = sip_tqt_config.SIPConfig("PyTQt 3.18.1") @@ -67,20 +67,20 @@ def usage(rcode = 2): rcode is the return code passed back to the calling process. """ - print "Usage:" - print " %s [-h] [-a version] [-b dir] [-c] [-d dir] [-g] [-j #] [-n dir] [-o dir] [-r] [-v dir]" % sip_tqt_config.script() - print "where:" - print " -h display this help message" - print " -a tag explicitly enable the qtpe module" - print " -b dir where pyuic and pylupdate will be installed [default %s]" % config.default_bin_dir - print " -c concatenate each module's C++ source files" - print " -d dir where the PyTQt modules will be installed [default %s]" % config.default_mod_dir - print " -g always release the GIL (SIP-TQt v3.x behaviour)" - print " -j # split the concatenated C++ source files into # pieces [default 1]" - print " -n dir the directory containing the TQScintilla header files [default %s]" % config.qt_inc_dir - print " -o dir the directory containing the TQScintilla library [default %s]" % config.qt_lib_dir - print " -r generate code with tracing enabled [default disabled]" - print " -v dir where the PyTQt .sip files will be installed [default %s]" % config.default_sip_dir + print("Usage:") + print(" %s [-h] [-a version] [-b dir] [-c] [-d dir] [-g] [-j #] [-n dir] [-o dir] [-r] [-v dir]" % sip_tqt_config.script()) + print("where:") + print(" -h display this help message") + print(" -a tag explicitly enable the qtpe module") + print(" -b dir where pyuic and pylupdate will be installed [default %s]" % config.default_bin_dir) + print(" -c concatenate each module's C++ source files") + print(" -d dir where the PyTQt modules will be installed [default %s]" % config.default_mod_dir) + print(" -g always release the GIL (SIP-TQt v3.x behaviour)") + print(" -j # split the concatenated C++ source files into # pieces [default 1]") + print(" -n dir the directory containing the TQScintilla header files [default %s]" % config.qt_inc_dir) + print(" -o dir the directory containing the TQScintilla library [default %s]" % config.qt_lib_dir) + print(" -r generate code with tracing enabled [default disabled]") + print(" -v dir where the PyTQt .sip files will be installed [default %s]" % config.default_sip_dir) sys.exit(rcode) @@ -439,7 +439,7 @@ def versionToTag(vers, tags, desc): """ tag = None - vl = tags.keys() + vl = list(tags.keys()) vl.sort() # For a snapshot use the latest tag. @@ -723,8 +723,7 @@ if __name__ == "__main__": except SystemExit: raise except: - print \ -"""An internal error occured. Please report all the output from the program, + print("""An internal error occured. Please report all the output from the program, including the following traceback, to support@riverbankcomputing.co.uk. -""" +""") raise -- cgit v1.2.3