diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-06-21 08:19:54 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-06-21 11:06:37 +0200 |
commit | dedfebbc438ed2f5f6869092ee10e68f9ffd8a36 (patch) | |
tree | 148a8f39a33bc1298071bd45f43d46f1a1c109dc /tools/qtpy2cpp.py | |
parent | bc17293f08a0fa1524b4b1a6cbc49fd1a59967fc (diff) |
qtpy2cpp: Further improvements
- Fix indentation of context manager scopes
- Fix indentation of augmented assignments
- Handle range based for over variable
- Remove FIXME comment for function types
- Write base name in header comment for testability
Pick-to: 6.3
Task-number: PYSIDE-1945
Change-Id: Ib30af672e56434c30d98f8dce2cb73ef0a1512a8
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'tools/qtpy2cpp.py')
-rw-r--r-- | tools/qtpy2cpp.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/qtpy2cpp.py b/tools/qtpy2cpp.py index 04a34a97d..6ab74d357 100644 --- a/tools/qtpy2cpp.py +++ b/tools/qtpy2cpp.py @@ -44,7 +44,8 @@ if __name__ == '__main__': ast_tree = ConvertVisitor.create_ast(input_file) if args.stdout: - sys.stdout.write(f'// Converted from {input_file}\n') + base_name = os.path.basename(input_file) + sys.stdout.write(f'// Converted from {base_name}\n') ConvertVisitor(input_file, sys.stdout).visit(ast_tree) sys.exit(0) @@ -58,6 +59,7 @@ if __name__ == '__main__': sys.exit(-1) with open(target_file, "w") as file: - file.write(f'// Converted from {input_file}\n') + base_name = os.path.basename(input_file) + file.write(f'// Converted from {base_name}\n') ConvertVisitor(input_file, file).visit(ast_tree) logger.info(f"Wrote {target_file} ...") |