aboutsummaryrefslogtreecommitdiffstats
path: root/tools/uic_test.py
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2022-03-30 20:51:17 +0200
committerCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2022-04-02 16:43:45 +0200
commit7e87bbbe1f59e275d1076b90ab9b1cd640bef78a (patch)
tree853311ca24a27d02ca6a7d583a9e22c352fbb822 /tools/uic_test.py
parentea86da2b9cd1996e50f0dce08b9cd144d49b364e (diff)
flake8: fix styling issues in tools/
Change-Id: I8cbf5d521900df4f55abf8f68997f8a71437f722 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tools/uic_test.py')
-rw-r--r--tools/uic_test.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/uic_test.py b/tools/uic_test.py
index 5f8a786a9..c889f2c05 100644
--- a/tools/uic_test.py
+++ b/tools/uic_test.py
@@ -47,7 +47,6 @@ from pathlib import Path
from textwrap import dedent
from typing import Optional, Tuple
-
VERSION = 6
@@ -59,15 +58,15 @@ TEMP_DIR = Path(tempfile.gettempdir())
def get_class_name(file: Path) -> Tuple[Optional[str], Optional[str]]:
"""Return class name and widget name of UI file."""
- pattern = re.compile('^\s*<widget class="(\w+)" name="(\w+)"\s*>.*$')
- for l in Path(file).read_text().splitlines():
- match = pattern.match(l)
+ pattern = re.compile(r'^\s*<widget class="(\w+)" name="(\w+)"\s*>.*$')
+ for line in Path(file).read_text().splitlines():
+ match = pattern.match(line)
if match:
return (match.group(1), match.group(2))
return (None, None)
-def test_file(file: str, uic: bool=False) -> bool:
+def test_file(file: str, uic: bool = False) -> bool:
"""Run uic on a UI file and show the resulting UI."""
path = Path(file)
(klass, name) = get_class_name(path)