From ccdc6c2dd3d4b7e7b6a06488c278e4c9f06e8925 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 29 Jan 2020 15:36:21 +0100 Subject: [PATCH] pro2cmake: Fix flake and mypy issues Change-Id: I33ab818c53f751ede7a7840b1086a3ae8263e109 Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index f6017880c2..04443b00b7 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -599,7 +599,7 @@ class QmlDir: qmldir_file.path = path return qmldir_file - def from_lines(self, lines: [str]): + def from_lines(self, lines: List[str]): for line in lines: self.handle_line(line) @@ -3139,7 +3139,7 @@ def write_example( """ ) - if qml_dir != None: + if qml_dir is not None: if qml_dir.designer_supported: add_target += " DESIGNER_SUPPORTED\n" if len(qml_dir.classname) != 0: @@ -3404,7 +3404,7 @@ def write_qml_plugin( cm_fh.write("\n ".join(import_list)) cm_fh.write(f"\n )\nendif()\n\n") - if qml_dir != None: + if qml_dir is not None: if qml_dir.designer_supported: extra_lines.append("DESIGNER_SUPPORTED") if len(qml_dir.classname) != 0: @@ -3516,7 +3516,7 @@ def handle_app_or_lib( # Generate qmltypes instruction for anything that may have CONFIG += qmltypes # that is not a qml plugin - if "qmltypes" in scope.get("CONFIG") and not "qml_plugin" in scope.get("_LOADED"): + if "qmltypes" in scope.get("CONFIG") and "qml_plugin" not in scope.get("_LOADED"): cm_fh.write(f"\n{spaces(indent)}set_target_properties({target} PROPERTIES\n") cm_fh.write(f"{spaces(indent+1)}QT_QML_MODULE_INSTALL_QMLTYPES TRUE\n") @@ -3531,7 +3531,7 @@ def handle_app_or_lib( raise RuntimeError(f"No QML_IMPORT_VERSION info found for target {target}.") if not import_minor_version: - import_minor_version = 0 + import_minor_version = str(0) import_version = f"{import_major_version}.{import_minor_version}" if import_version: