diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-10-22 13:30:15 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-10-24 21:03:01 +0200 |
commit | 0aea91d5dc3fc205e0e96fee9715253acd8bf207 (patch) | |
tree | 7d8f8025504df3390c8a2b00f28abbba8342b42f | |
parent | 5f651f7632cf298a2ee5504aee533c0896f94e81 (diff) |
Registry/init_platform.py: Output build information
Add Python version/build and Qt build to the header.
Change-Id: I1cf39c4cb3663511087af737bbe2257038e19fb6
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r-- | sources/pyside2/tests/registry/init_platform.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/sources/pyside2/tests/registry/init_platform.py b/sources/pyside2/tests/registry/init_platform.py index 15cf46097..52fd4705d 100644 --- a/sources/pyside2/tests/registry/init_platform.py +++ b/sources/pyside2/tests/registry/init_platform.py @@ -58,6 +58,15 @@ import re from contextlib import contextmanager from textwrap import dedent +def qt_build(): + result = '<Unknown build of Qt>' + try: + from PySide2.QtCore import QLibraryInfo + result = QLibraryInfo.build() + except: + pass + return result + script_dir = os.path.normpath(os.path.join(__file__, *".. .. .. .. ..".split())) history_dir = os.path.join(script_dir, 'build_history') @@ -262,16 +271,22 @@ def generate_all(): license_line = next((lno for lno, line in enumerate(lines) if "$QT_END_LICENSE$" in line)) fmt.print("".join(lines[:license_line + 3])) + version = sys.version.replace('\n', ' ') + build = qt_build() fmt.print(dedent('''\ """ This file contains the simplified signatures for all functions in PySide - for module '{}'. There are no default values, no variable - names and no self parameter. Only types are present after simplification. - The functions 'next' resp. '__next__' are removed to make the output + for module '{module}' using + Python {version} + {build} + + There are no default values, no variable names and no self + parameter. Only types are present after simplification. The + functions 'next' resp. '__next__' are removed to make the output identical for Python 2 and 3. '__div__' is also removed, since it exists in Python 2, only. """ - '''.format(module))) + '''.format(**locals()))) fmt.print("import sys") fmt.print("") fmt.print("sig_dict = {}") |