Skip to content

Commit

Permalink
fix gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Jul 27, 2024
1 parent c2557a9 commit be49478
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dev/gen_sinter_api_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ def main():
p = __import__(package)
for name in dir(p):
x = getattr(p, name)
if isinstance(x, type) and '_' in str(x) and 'class' in str(x):
if isinstance(x, type) and 'class' in str(x):
desired_name = f'{package}.{name}'
bad_name = str(x).split("'")[1]
if '._' in str(x):
bad_name = str(x).split("'")[1]
replace_rules.append((bad_name, desired_name))
lonely_name = desired_name.split(".")[-1]
replace_rules.append((bad_name, desired_name))
for q in ['"', "'"]:
replace_rules.append(('ForwardRef(' + q + lonely_name + q + ')', desired_name))
replace_rules.append(('ForwardRef(' + q + desired_name + q + ')', desired_name))
Expand Down

0 comments on commit be49478

Please sign in to comment.