From 271482f5ce9d095972b8ecf0a3fc024fa1274386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drik=20Fuoco?= Date: Fri, 1 Nov 2024 11:01:44 -0400 Subject: [PATCH] Windows fix part2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédrik Fuoco --- cmake/dependencies/openssl.cmake | 13 +- .../patch/python.3.11.get_externals.bat.patch | 6 +- .../patch/python.3.11.python.props.patch | 6 +- cmake/dependencies/python3.cmake | 17 - requirements.txt | 9 +- src/lib/mu/MuQt6/qt6_to_mu.py | 293 +++++++++++++----- 6 files changed, 230 insertions(+), 114 deletions(-) diff --git a/cmake/dependencies/openssl.cmake b/cmake/dependencies/openssl.cmake index ad0d5435..7bfa1368 100644 --- a/cmake/dependencies/openssl.cmake +++ b/cmake/dependencies/openssl.cmake @@ -131,9 +131,10 @@ ELSE() # Ref: https://github.com/openssl/openssl/blob/398011848468c7e8e481b295f7904afc30934217/INSTALL.md?plain=1#L1847-L1858 - IF(RV_TARGET_LINUX) - RV_VFX_SET_VARIABLE(_dot_version CY2023 ".1.1" CY2024 ".3") + RV_VFX_SET_VARIABLE(_dot_version CY2023 ".1.1" CY2024 ".3") + RV_VFX_SET_VARIABLE(_underscore_version CY2023 "1_1" CY2024 "3") + IF(RV_TARGET_LINUX) SET(_crypto_lib_name ${CMAKE_SHARED_LIBRARY_PREFIX}crypto${CMAKE_SHARED_LIBRARY_SUFFIX}${_dot_version} ) @@ -144,17 +145,17 @@ ELSE() ELSEIF(RV_TARGET_WINDOWS) # As stated in the openssl documentation, the names are libcrypto-1_1-x64 and libssl-1_1-x64 when OpenSSL is build with MSVC. SET(_crypto_lib_name - libcrypto-1_1-x64${CMAKE_SHARED_LIBRARY_SUFFIX} + libcrypto-${_underscore_version}-x64${CMAKE_SHARED_LIBRARY_SUFFIX} ) SET(_ssl_lib_name - libssl-1_1-x64${CMAKE_SHARED_LIBRARY_SUFFIX} + libssl-${_underscore_version}-x64${CMAKE_SHARED_LIBRARY_SUFFIX} ) ELSE() SET(_crypto_lib_name - ${CMAKE_SHARED_LIBRARY_PREFIX}crypto.1.1${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_SHARED_LIBRARY_PREFIX}crypto${_dot_version}${CMAKE_SHARED_LIBRARY_SUFFIX} ) SET(_ssl_lib_name - ${CMAKE_SHARED_LIBRARY_PREFIX}ssl.1.1${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_SHARED_LIBRARY_PREFIX}ssl${_dot_version}${CMAKE_SHARED_LIBRARY_SUFFIX} ) ENDIF() diff --git a/cmake/dependencies/patch/python.3.11.get_externals.bat.patch b/cmake/dependencies/patch/python.3.11.get_externals.bat.patch index a6973938..0da6ccb7 100644 --- a/cmake/dependencies/patch/python.3.11.get_externals.bat.patch +++ b/cmake/dependencies/patch/python.3.11.get_externals.bat.patch @@ -1,5 +1,5 @@ diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat -index b4362a5a25..5deb59828f 100644 +index b4362a5a259..2b17da6ae5e 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -53,7 +53,7 @@ echo.Fetching external libraries... @@ -7,7 +7,7 @@ index b4362a5a25..5deb59828f 100644 set libraries=%libraries% bzip2-1.0.8 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.4.4 -if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-3.0.13 -+if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1u ++if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-3.4.0 set libraries=%libraries% sqlite-3.45.1.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.12.1 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.12.1 @@ -16,7 +16,7 @@ index b4362a5a25..5deb59828f 100644 set binaries= if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi-3.4.4 -if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-3.0.13 -+if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1u ++if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-3.4.0 if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.12.1 if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06 diff --git a/cmake/dependencies/patch/python.3.11.python.props.patch b/cmake/dependencies/patch/python.3.11.python.props.patch index 01a3b804..d90006dd 100644 --- a/cmake/dependencies/patch/python.3.11.python.props.patch +++ b/cmake/dependencies/patch/python.3.11.python.props.patch @@ -1,5 +1,5 @@ diff --git a/PCbuild/python.props b/PCbuild/python.props -index d85fe4ab2a..ff2224251f 100644 +index d85fe4ab2a3..977cf19e57f 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -74,8 +74,8 @@ @@ -8,8 +8,8 @@ index d85fe4ab2a..ff2224251f 100644 $(libffiOutDir)include - $(ExternalsDir)openssl-3.0.13\ - $(ExternalsDir)openssl-bin-3.0.13\$(ArchName)\ -+ $(ExternalsDir)openssl-1.1.1u\ -+ $(ExternalsDir)openssl-bin-1.1.1u\$(ArchName)\ ++ $(ExternalsDir)openssl-3.4.0\ ++ $(ExternalsDir)openssl-bin-3.4.0\$(ArchName)\ $(opensslOutDir)include $(ExternalsDir)\nasm-2.11.06\ $(ExternalsDir)\zlib-1.3.1\ diff --git a/cmake/dependencies/python3.cmake b/cmake/dependencies/python3.cmake index ffdbdca4..9a8fca9b 100644 --- a/cmake/dependencies/python3.cmake +++ b/cmake/dependencies/python3.cmake @@ -256,22 +256,6 @@ SET(_requirements_install_command "${_python3_executable}" -m pip install --upgrade -r "${_requirements_file}" ) -IF(RV_TARGET_WINDOWS) - SET(_patch_python3_11_command - "patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/python.3.11.openssl.props.patch &&\ - patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/python.3.11.python.props.patch &&\ - patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/python.3.11.get_externals.bat.patch" - ) - - RV_VFX_SET_VARIABLE(_patch_command CY2023 "" CY2024 "${_patch_python3_11_command}") - # Split the command into a semi-colon separated list. - SEPARATE_ARGUMENTS(_patch_command) - STRING( - REGEX - REPLACE ";+" ";" _patch_command "${_patch_command}" - ) -ENDIF() - EXTERNALPROJECT_ADD( ${_python3_target} DOWNLOAD_NAME ${_python3_target}_${_python3_version}.zip @@ -282,7 +266,6 @@ EXTERNALPROJECT_ADD( URL ${_python3_download_url} URL_MD5 ${_python3_download_hash} DEPENDS OpenSSL::Crypto OpenSSL::SSL - PATCH_COMMAND "${_patch_command}" CONFIGURE_COMMAND ${_python3_make_command} --configure BUILD_COMMAND ${_python3_make_command} --build INSTALL_COMMAND ${_python3_make_command} --install diff --git a/requirements.txt b/requirements.txt index 7eda5034..ad5d69c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,9 @@ pyyaml # License: MIT License (MIT) requests # License: Apache Software License (Apache 2.0) wheel # License: MIT License (MIT) -pyzstd==0.15.9; python_version <= '3.10' # License: BSD License (BSD-3-Clause) -pyzstd; python_version > '3.10' # License: BSD License (BSD-3-Clause) -py7zr==0.22.0 # License: GNU Lesser General Public License v2 or later (LGPLv2+) (LGPL-2.1-or-later) \ No newline at end of file +pyzstd==0.15.9; python_version <= '3.8' # License: BSD License (BSD-3-Clause) +pyzstd; python_version > '3.8' # License: BSD License (BSD-3-Clause) +py7zr==0.22.0; python_version <= '3.8' # License: GNU Lesser General Public License v2 or later (LGPLv2+) (LGPL-2.1-or-later) +py7zr; python_version > '3.8' # License: GNU Lesser General Public License v2 or later (LGPLv2+) (LGPL-2.1-or-later) +dohq-artifactory # License: MIT License (MIT License) +pre-commit diff --git a/src/lib/mu/MuQt6/qt6_to_mu.py b/src/lib/mu/MuQt6/qt6_to_mu.py index 1a3effb0..c4051b3b 100755 --- a/src/lib/mu/MuQt6/qt6_to_mu.py +++ b/src/lib/mu/MuQt6/qt6_to_mu.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -# Copyright (C) 2023 Autodesk, Inc. All Rights Reserved. -# -# SPDX-License-Identifier: Apache-2.0 +# Copyright (C) 2023 Autodesk, Inc. All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 # from sgmllib import SGMLParser import urllib @@ -264,7 +264,7 @@ "qwheelevent", "qtextbrowser", "qsinglepointevent", - "qpointerevent" + "qpointerevent", ] # @@ -423,7 +423,7 @@ # "QWebEngineHistory", "QWindowStateChangeEvent", "QSinglePointEvent", - "QPointerEvent" + "QPointerEvent", ] ) # "QTouchEvent", @@ -530,7 +530,7 @@ def sansElaborations(x): def repMapFind(x): - for (rexp, val) in repMap: + for rexp, val in repMap: if rexp.match(x): return val return None @@ -768,7 +768,7 @@ def repMapFind(x): re.compile("QAbstract.*"), re.compile("QLayout"), re.compile("QIODevice"), - re.compile("QIODeviceBase") + re.compile("QIODeviceBase"), ] @@ -848,10 +848,7 @@ def indexOf(element, sequence): # doProps = ["QInputDialog"] -doPropsIfFuncToo = [ - "primaryScreen", - "availableGeometry" -] +doPropsIfFuncToo = ["primaryScreen", "availableGeometry"] noHFileOutput = [] # ["QObject"] @@ -914,7 +911,7 @@ def indexOf(element, sequence): "QProcess::createProcessArgumentsModifier": None, "QProcess::setCreateProcessArgumentsModifier": None, "QProcess::setChildProcessModifier": None, - "QProcess::startDetached": None, # handrolled + "QProcess::startDetached": None, # handrolled "QMenuBar::defaultAction": None, "QMenuBar::setDefaultAction": None, "QPlainTextEdit::extraSelections": None, @@ -1096,52 +1093,133 @@ def indexOf(element, sequence): ], # Issue with std::variant and Types: "const std::variant" "QVariant::fromStdVariant": None, - "QFile::QFile":[ - ('QFile', '', [('name', 'const std::filesystem::path &', None)], '', False), - ('QFile', '', [('name', 'const std::filesystem::path &', None), ('parent', 'QObject *', None)], '', False) + "QFile::QFile": [ + ("QFile", "", [("name", "const std::filesystem::path &", None)], "", False), + ( + "QFile", + "", + [ + ("name", "const std::filesystem::path &", None), + ("parent", "QObject *", None), + ], + "", + False, + ), ], "QFile::filesystemFileName": None, "QFile::filesystemSymLinkTarget": None, - "QFile::link":[ - ('link', '', [('newName', 'const std::filesystem::path &', None)], 'bool', False) + "QFile::link": [ + ( + "link", + "", + [("newName", "const std::filesystem::path &", None)], + "bool", + False, + ) ], - "QFile::rename":[ - ('rename', '', [('newName', 'const std::filesystem::path &', None)], 'bool', False) + "QFile::rename": [ + ( + "rename", + "", + [("newName", "const std::filesystem::path &", None)], + "bool", + False, + ) ], - "QFile::setFileName":[ - ('setFileName', '', [('name', 'const std::filesystem::path &', None)], 'void', False) + "QFile::setFileName": [ + ( + "setFileName", + "", + [("name", "const std::filesystem::path &", None)], + "void", + False, + ) ], - "QFile::permissions":[ - ('permissions', '', [('filename', 'const std::filesystem::path &', None)], 'QFileDevice::Permissions', False) + "QFile::permissions": [ + ( + "permissions", + "", + [("filename", "const std::filesystem::path &", None)], + "QFileDevice::Permissions", + False, + ) ], - "QFile::copy":[ - ('copy', '', [('newName', 'const std::filesystem::path &', None)], 'bool', False) + "QFile::copy": [ + ( + "copy", + "", + [("newName", "const std::filesystem::path &", None)], + "bool", + False, + ) ], - "QFile::setPermissions":[ - ('setPermissions', '', [('permissions', 'QFileDevice::Permissions', None)], 'virtual bool', False), - ('setPermissions', '', [('fileName', 'const QString &', None), ('permissions', 'QFileDevice::Permissions', None)], 'bool', False), - ('setPermissions', '', [('filename', 'const std::filesystem::path &', None), ('permissionSpec', 'QFileDevice::Permissions', None)], 'bool', False) + "QFile::setPermissions": [ + ( + "setPermissions", + "", + [("permissions", "QFileDevice::Permissions", None)], + "virtual bool", + False, + ), + ( + "setPermissions", + "", + [ + ("fileName", "const QString &", None), + ("permissions", "QFileDevice::Permissions", None), + ], + "bool", + False, + ), + ( + "setPermissions", + "", + [ + ("filename", "const std::filesystem::path &", None), + ("permissionSpec", "QFileDevice::Permissions", None), + ], + "bool", + False, + ), ], # Issue with conversion QString to QString * "QFile::moveToTrash": [ ( - "moveToTrash", - "", - [("fileName", "const QString &", None), ("pathInTrash", "QString *", "nullptr")], - "bool", - False + "moveToTrash", + "", + [ + ("fileName", "const QString &", None), + ("pathInTrash", "QString *", "nullptr"), + ], + "bool", + False, ) ], # QFile has funky semantics which screw things up in QFileInfo # so these have to be done manually "QFileInfo::QFileInfo": [ - ('QFileInfo', '', [('file', 'const QFileDevice &', None)], '', False), - ('QFileInfo', '', [('dir', 'const QDir &', None), ('file', 'const std::filesystem::path &', None)], '', False), - ('QFileInfo', '', [('file', 'const std::filesystem::path &', None)], '', False) + ("QFileInfo", "", [("file", "const QFileDevice &", None)], "", False), + ( + "QFileInfo", + "", + [ + ("dir", "const QDir &", None), + ("file", "const std::filesystem::path &", None), + ], + "", + False, + ), + ("QFileInfo", "", [("file", "const std::filesystem::path &", None)], "", False), ], "QFileInfo::setFile": [ - ('setFile', '', [('file', 'const std::filesystem::path &', None)], 'void', False), - ('setFile', '', [('file', 'const QFileDevice &', None)], 'void', False) + ( + "setFile", + "", + [("file", "const std::filesystem::path &", None)], + "void", + False, + ), + ("setFile", "", [("file", "const QFileDevice &", None)], "void", False), ], "QFileInfo::operator!=": [ ( @@ -1233,7 +1311,7 @@ def indexOf(element, sequence): "QTextOption::tabs": None, # Syntax error with "const QList arg1 = (&)(param_selections);" "QTextEdit::setExtraSelections": None, - "QTextStream::QTextStream": None, # handrolled + "QTextStream::QTextStream": None, # handrolled "QTextStream::setString": None, "QTextStream::string": None, "QTextStream::readLineInto": None, @@ -1241,7 +1319,7 @@ def indexOf(element, sequence): "QTextStream::operator>>": None, # cannot convert from 'std::chrono::milliseconds' to 'int' "QTimer::intervalAsDuration": None, - # cannot convert from 'std::chrono::milliseconds' to 'int' + # cannot convert from 'std::chrono::milliseconds' to 'int' "QTimer::remainingTimeAsDuration": None, "QCursor::bitmap": None, "QCursor::mask": None, @@ -1262,7 +1340,7 @@ def indexOf(element, sequence): "QWebEngineView::findText": None, "QMenu::setAsDockMenu": None, # Trouble with std::initializer_list - # syntax error: std::initializer_list > arg1 = (>)(param_list); + # syntax error: std::initializer_list > arg1 = (>)(param_list); "QUrlQuery::QUrlQuery": [ ( "QUrlQuery", @@ -1274,13 +1352,16 @@ def indexOf(element, sequence): False, ) ], - "QQuickItem::itemChange":[ + "QQuickItem::itemChange": [ ( - "itemChange", - "", - [("change", "QQuickItem::ItemChange", None), ("value", "const QQuickItem::ItemChangeData &", None)], - "virtual void", - False + "itemChange", + "", + [ + ("change", "QQuickItem::ItemChange", None), + ("value", "const QQuickItem::ItemChangeData &", None), + ], + "virtual void", + False, ) ], # Syntax issue with 'const QVector arg1 = (&)(param_properties);' @@ -1337,17 +1418,43 @@ def indexOf(element, sequence): ), ], "QDir::QDir": [ - ('QDir', '', [('path', 'const std::filesystem::path &', None), ('nameFilter', 'const QString &', None), ('sort', 'QDir::SortFlags', 'SortFlags(Name | IgnoreCase)'), ('filters', 'QDir::Filters', 'AllEntries')], '', False), - ('QDir', '', [('path', 'const std::filesystem::path &', None)], '', False) + ( + "QDir", + "", + [ + ("path", "const std::filesystem::path &", None), + ("nameFilter", "const QString &", None), + ("sort", "QDir::SortFlags", "SortFlags(Name | IgnoreCase)"), + ("filters", "QDir::Filters", "AllEntries"), + ], + "", + False, + ), + ("QDir", "", [("path", "const std::filesystem::path &", None)], "", False), ], "QDir::filesystemAbsolutePath": None, "QDir::filesystemCanonicalPath": None, "QDir::filesystemPath": None, "QDir::setPath": [ - ('setPath', '', [('path', 'const std::filesystem::path &', None)], 'void', False) + ( + "setPath", + "", + [("path", "const std::filesystem::path &", None)], + "void", + False, + ) ], "QDir::addSearchPath": [ - ('addSearchPath', '', [('prefix', 'const QString &', None), ('path', 'const std::filesystem::path &', None)], 'void', False) + ( + "addSearchPath", + "", + [ + ("prefix", "const QString &", None), + ("path", "const std::filesystem::path &", None), + ], + "void", + False, + ) ], "QFileInfo::filesystemAbsoluteFilePath": None, "QFileInfo::filesystemAbsolutePath": None, @@ -1358,6 +1465,8 @@ def indexOf(element, sequence): "QFileInfo::filesystemPath": None, "QFileInfo::filesystemReadSymLink": None, "QFileInfo::filesystemSymLinkTarget": None, + "QUrl::fromAce": None, + "QUrl::toAce": None, } customNativeFuncsHeader = { @@ -1720,33 +1829,34 @@ def parseParameter(param, n): def parse_cpp_function(function_signature): # Updated regular expression to handle operator overloading - pattern = r'^((?:template\s+)?(?:virtual\s+)?(?:explicit\s+)?(?:[\w:]+(?:<.*?>)?(?:\s*[\*&])?\s+)+)?\s*(\~?\w+(?:::\w+)*|\w+\s*(?:<.*?>)?::(?:~?\w+|operator\s*\S+)|operator\s*\S+)\s*(\(.*?\))(?:\s*((?:const)?\s*(?:noexcept)?\s*(?:override)?\s*(?:final)?\s*(?:&)?\s*(?:->.*?)?(?:=\s*\w+)?))?$' - + pattern = r"^((?:template\s+)?(?:virtual\s+)?(?:explicit\s+)?(?:[\w:]+(?:<.*?>)?(?:\s*[\*&])?\s+)+)?\s*(\~?\w+(?:::\w+)*|\w+\s*(?:<.*?>)?::(?:~?\w+|operator\s*\S+)|operator\s*\S+)\s*(\(.*?\))(?:\s*((?:const)?\s*(?:noexcept)?\s*(?:override)?\s*(?:final)?\s*(?:&)?\s*(?:->.*?)?(?:=\s*\w+)?))?$" + match = re.match(pattern, function_signature.strip()) - + if not match: return None, None, None, None - + return_type, function_name, parameters, after_parameters = match.groups() - + # Clean up the matches if return_type: return_type = return_type.strip() else: return_type = "" - + function_name = function_name.strip() - + # Fix this as this remove () for thing like Qt::WindowsFlag() parameters = parameters[1:-1] - + if after_parameters: after_parameters = after_parameters.strip() else: after_parameters = "" - + return return_type, function_name, parameters, after_parameters + def parseFunction(func, qtnamespace): orig_func = func # parts = func.split("(") @@ -1769,7 +1879,7 @@ def parseFunction(func, qtnamespace): demoted = False if len(func) == 0: return None - + message("Processing function " + func) if func[-1] == "@": # demote virtual props to not props otherwise we can't create @@ -1853,18 +1963,24 @@ def parseFunction(func, qtnamespace): params[i] = (p[0] + "_", p[1], p[2]) if nameproto: - v = (nameproto[-1], thistype, params, string.join(nameproto[0:-1]), prop) + v = ( + nameproto[-1], + thistype, + params, + string.join(nameproto[0:-1]), + prop, + ) if demoted: qtnamespace.demotedProps.append(v) # message("PROP demoted " + str(func)) return v else: - message("WARNING: Nameproto empty for " + func) + message("WARNING: Nameproto empty for " + func) except: # Skip any function that has issue with the simple parsing above. print("Error parsing function.. skipping: {0}".format(orig_func)) return None - + return None @@ -2087,8 +2203,8 @@ def __init__(self, enumeration, muclass): if e.name != "\n": # TODO: Might not be the right place to do it, but it works. # Remove anything parenthesis and spacing in the name. - pattern = r'\([^)]*\)' - e.name = re.sub(pattern, '', e.name).strip() + pattern = r"\([^)]*\)" + e.name = re.sub(pattern, "", e.name).strip() name_without_class_name = e.name.split(muclass.name, 1)[1] # Could use e.name for val, but let's keep the logic similar. val = muclass.name + name_without_class_name @@ -2160,7 +2276,11 @@ def __init__(self, api, muclass, qtfunc, isMember, isProtected, isCastOp): self.purevirtual = "= 0" in qtfunc[1] print("Processing function {0}".format(qtfunc)) - print("failed: {0}, isprop: {1}, isprotected: {2}".format(str(self.failed), str(self.isprop), str(self.isprotected))) + print( + "failed: {0}, isprop: {1}, isprotected: {2}".format( + str(self.failed), str(self.isprop), str(self.isprotected) + ) + ) if self.operator: self.name = name[8 : len(name)] @@ -2185,12 +2305,15 @@ def __init__(self, api, muclass, qtfunc, isMember, isProtected, isCastOp): else: self.args.append(("this", muclass.name, None)) - for (aname, atype, aval) in args: + for aname, atype, aval in args: message("Trying to translate (%s, %s) for %s" % (atype, c, name)) mutype = api.translate(atype, c) if mutype == None: self.failed = True - message("%s failed because api.translate(%s,%s) return None" % (name, atype, c)) + message( + "%s failed because api.translate(%s,%s) return None" + % (name, atype, c) + ) mutype = '"%s"' % atype self.args.append((aname, mutype, aval)) @@ -2290,7 +2413,7 @@ def symbolDeclaration(self): ) if self.args: out += "Parameters, " - for (aname, atype, aval) in self.args: + for aname, atype, aval in self.args: atype = conditionType(atype) if self.muclass.muapi.classes.has_key(atype): atype = "qt." + atype @@ -2328,7 +2451,7 @@ def nodeImplementation(self): out += "%s(NODE_THREAD" % self.compiled if self.args: count = 0 - for (aname, atype, aval) in self.args: + for aname, atype, aval in self.args: rep = repMapFind(atype) (repType, instType) = rep if count == 0 and self.ismember: @@ -2423,7 +2546,7 @@ def compiledFunction(self): return "// NO FUNC: CONSTRUCTOR IS PROTECTED: %s" % self.muDeclaration() rep = repMapFind(self.rtype) out = "%s %s(Mu::Thread& NODE_THREAD" % (rep[0], self.compiled) - for (aname, atype, aval) in self.args: + for aname, atype, aval in self.args: rep = repMapFind(atype) out += ", %s param_%s" % (rep[0], aname) out += ")\n{\n" @@ -2672,7 +2795,7 @@ def compiledFunction(self): def muDeclaration(self): out = "%s (%s; " % (self.name, self.rtype) comma = False - for (aname, mutype, aval) in self.args: + for aname, mutype, aval in self.args: if comma: out += ", " out += "%s %s" % (mutype, aname) @@ -2714,7 +2837,10 @@ def __init__(self, api, qtnamespace, muapi): fname = f[0] rtype = f[3] cppname = qtnamespace.name + "::" + fname - message("functions fname = %s, rtype = %s, cppname = %s" % (fname, rtype, cppname)) + message( + "functions fname = %s, rtype = %s, cppname = %s" + % (fname, rtype, cppname) + ) exclude = isFunctionExcluded(qtnamespace, f) if exclude and verbose: print("EXCLUDED:", str(f)) @@ -2765,7 +2891,10 @@ def __init__(self, api, qtnamespace, muapi): cppname = qtnamespace.name + "::" + fname exclude = isFunctionExcluded(qtnamespace, f) print(qtnamespace) - message("staticfuncs fname = %s, cppname = %s, exclude = %s" % (fname, cppname, str(exclude))) + message( + "staticfuncs fname = %s, cppname = %s, exclude = %s" + % (fname, cppname, str(exclude)) + ) if not exclude: self.statics.append( MuFunction( @@ -3425,7 +3554,7 @@ def outputSourceFiles(self): cppout = open("qtGlobals.cpp", "w") else: cppout = open(name + "Type.cpp", "w") - + cppout.writelines(cpplines) cppout.close() @@ -3674,7 +3803,7 @@ def end_title(self): self.qtnamespace.isclass = isclass def start_span(self, attrs): - for (attr, value) in attrs: + for attr, value in attrs: if value == "small-subtitle": self.modulespan = True @@ -3701,11 +3830,11 @@ def end_p(self): def start_a(self, attrs): if self.ininheritedby: - for (attr, value) in attrs: + for attr, value in attrs: if attr == "href": self.addChildURL(value) elif self.infunc: - for (attr, value) in attrs: + for attr, value in attrs: if attr == "href": self.funcIsProp = value.rfind("-prop") != -1 self.acount += 1 @@ -3996,7 +4125,7 @@ def recursiveParse(url): # if "qwidget.html" in u: absPath = os.path.join(os.path.dirname(url), u) recursiveParse(absPath) - except (IOError): + except IOError: print("FAILED: (IOError)", url) except: sys.stdout.flush() @@ -4198,4 +4327,4 @@ def findHTMLinDocTree(rootname): typelist.append(t) typelist.sort() - pp.pprint(typelist) \ No newline at end of file + pp.pprint(typelist)