From 66615a89ef66c39d62a502df3eb1ff629aa39154 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Sat, 14 Jul 2018 15:10:56 +0200 Subject: 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 Reviewed-by: Alexandru Croitor --- sources/pyside2/PySide2/support/signature/loader.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sources/pyside2/PySide2/support/signature/loader.py') 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 -- cgit v1.2.3