diff --git a/etgtools/extractors.py b/etgtools/extractors.py index bb9ce465..2d9d0c42 100644 --- a/etgtools/extractors.py +++ b/etgtools/extractors.py @@ -538,7 +538,7 @@ class FunctionDef(BaseDef, FixWxPrefix): default = '|'.join([self.cleanName(x, True) for x in default.split('|')]) s = f'{s}={default}' elif param_type: - s = f'{s} : {param_type}' + s = f'{s}: {param_type}' params.append(s) self.pyArgsString = f"({', '.join(params)})" diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index b41768b3..b1b333f5 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -622,7 +622,9 @@ class ParameterList(Node): theargs = [] for arg in arguments: - + arg = arg.split(':')[0].strip() # Remove the typehint + if arg in ('_from', '_def', '_is'): # Reserved Python keywords we've had to rename + arg = arg[1:] myarg = arg.split('=')[0].strip() if myarg: theargs.append(myarg) diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index dc74b646..8dfd3745 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -150,7 +150,8 @@ class FixWxPrefix(object): Finally, the 'wx.' prefix is added if needed. """ - for txt in ['const', '*', '&', ' ']: + name = re.sub(r'(const(?![\w\d]))', '', name) # remove 'const', but not 'const'raints + for txt in ['*', '&', ' ']: name = name.replace(txt, '') name = name.replace('::', '.') if not is_expression: