diff options
author | Christian Tismer <tismer@stackless.com> | 2018-07-14 15:10:56 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2018-10-11 09:47:47 +0000 |
commit | 66615a89ef66c39d62a502df3eb1ff629aa39154 (patch) | |
tree | a944523097505fb80b6c41ac8518e3fd02a3ca74 /sources/pyside2/PySide2/support/signature/loader.py | |
parent | c6395441a1df9b1cc59716b9dad18973bcb72c69 (diff) |
Prepare the Signature Module For More Applications
This is the preparation for a number of planned applications
and extensions using the signature module.
This general overhaul contains:
- Extraction of signature enumerations into enum_sigs.py,
- a list of current keyword errors in arguments which are unsolved
in shiboken, but temporarily fixed in parser.py (too many for XML),
- fix spurious duplications in multiple signatures
- corrections for keyword errors in function names which cannot be
fixed by Python (quite few),
- fixing "..." arguments into "*args",
- supporting the "slot wrapper" type. This is necessary for
methods like "__add__", "__mul__" etc.
- Create an extra function "get_signature" that has a parameter to
modify the appearance, i.e. without self, without returntype, etc.
Task-number: PYSIDE-510
Change-Id: If16f7bf02c6e7cbbdc970058bb630ea4db2b854a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/support/signature/loader.py')
-rw-r--r-- | sources/pyside2/PySide2/support/signature/loader.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sources/pyside2/PySide2/support/signature/loader.py b/sources/pyside2/PySide2/support/signature/loader.py index f51bafe79..a055337bf 100644 --- a/sources/pyside2/PySide2/support/signature/loader.py +++ b/sources/pyside2/PySide2/support/signature/loader.py @@ -1,6 +1,6 @@ ############################################################################# ## -## Copyright (C) 2017 The Qt Company Ltd. +## Copyright (C) 2018 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of Qt for Python. @@ -82,13 +82,17 @@ sys.path.pop(0) # break the Python license decorated files without an encoding line. # name used in signature.cpp -def create_signature(props, sig_kind): +def create_signature(props, key): if not props: # empty signatures string return if isinstance(props["multi"], list): - return list(create_signature(elem, sig_kind) + return list(create_signature(elem, key) for elem in props["multi"]) + if type(key) is tuple: + sig_kind, modifier = key + else: + sig_kind, modifier = key, None varnames = props["varnames"] if sig_kind == "method": varnames = ("self",) + varnames |