mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
Fixups for buildings docs (sphinx_generator):
- Remove typehints from argsString before checking signature - lie and detect `_from`, `_is`, and `_def` as `from`, `is`, and `def for signature validating purposes - Fix: don't remove const from identifiers containing const (eg: constraint)
This commit is contained in:
@@ -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)})"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user