aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/project/project_data.py
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2024-01-24 15:58:25 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-02-02 21:25:14 +0100
commitfec10bbbc097eff76a1f618f2791b3df1326594f (patch)
treeac644bdf31a593cff567a9010b5b9cf7cf9c9ee0 /sources/pyside-tools/project/project_data.py
parentf6538d29fbd7d216ce00cdc2870c3a1055a24d26 (diff)
PySide Tools: Fix flake8 warnings
- Fix general flake8 warnings in pyside-tools. - add F401 to .flake8 to ignore unused imports from __init__.py files - add E402 from __init__.py to prevent errors related to partial initialization of modules. Pick-to: 6.6 6.5 Change-Id: Ia848b08ff6f0d2808e04f6a83c46636e2d167c02 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/project/project_data.py')
-rw-r--r--sources/pyside-tools/project/project_data.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/pyside-tools/project/project_data.py b/sources/pyside-tools/project/project_data.py
index b8d27f33e..416089dce 100644
--- a/sources/pyside-tools/project/project_data.py
+++ b/sources/pyside-tools/project/project_data.py
@@ -11,6 +11,7 @@ from . import (METATYPES_JSON_SUFFIX, PROJECT_FILE_SUFFIX, qt_metatype_json_dir,
MOD_CMD, QML_IMPORT_MAJOR_VERSION, QML_IMPORT_MINOR_VERSION, QML_IMPORT_NAME,
QT_MODULES)
+
def is_python_file(file: Path) -> bool:
return (file.suffix == ".py"
or sys.platform == "win32" and file.suffix == ".pyw")
@@ -106,7 +107,7 @@ class ProjectData:
# __main__ not found
print(
- "Python file with main function not found. Add the file to" f" {project_file}",
+ "Python file with main function not found. Add the file to" f" {self.project_file}",
file=sys.stderr,
)
sys.exit(1)
@@ -233,4 +234,3 @@ def check_qml_decorators(py_file: Path) -> Tuple[bool, QmlProjectData]:
if v:
qml_project_data.qt_modules = v
return (has_class, qml_project_data)
-