Enable return-type annotations

With the work from the previous commits, it's as simple as
no longer lopping off the args string at the '->' marker.
(And one minor fixup to the makePyArgsString code).
This commit is contained in:
lojack5
2023-10-17 17:28:19 -06:00
parent 6b6b810cc4
commit 2c6100cead
2 changed files with 1 additions and 7 deletions

View File

@@ -466,7 +466,7 @@ class FunctionDef(BaseDef, FixWxPrefix):
params = list() params = list()
returns = list() returns = list()
if self.type and self.type != 'void': if self.type and self.type != 'void':
returns.append(self.cleanName(self.type)) returns.append(self.cleanType(self.type))
defValueMap = { 'true': 'True', defValueMap = { 'true': 'True',
'false': 'False', 'false': 'False',

View File

@@ -380,9 +380,6 @@ class PiWrapperGenerator(generators.WrapperGeneratorBase, FixWxPrefix):
argsString = function.pyArgsString argsString = function.pyArgsString
if not argsString: if not argsString:
argsString = '()' argsString = '()'
if '->' in argsString:
pos = argsString.find(')')
argsString = argsString[:pos+1]
if '(' != argsString[0]: if '(' != argsString[0]:
pos = argsString.find('(') pos = argsString.find('(')
argsString = argsString[pos:] argsString = argsString[pos:]
@@ -552,9 +549,6 @@ class PiWrapperGenerator(generators.WrapperGeneratorBase, FixWxPrefix):
argsString = method.pyArgsString argsString = method.pyArgsString
if not argsString: if not argsString:
argsString = '()' argsString = '()'
if '->' in argsString:
pos = argsString.find(') ->')
argsString = argsString[:pos+1]
if '(' != argsString[0]: if '(' != argsString[0]:
pos = argsString.find('(') pos = argsString.find('(')
argsString = argsString[pos:] argsString = argsString[pos:]