-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmake_proplist.py
More file actions
33 lines (19 loc) · 752 Bytes
/
Copy pathmake_proplist.py
File metadata and controls
33 lines (19 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from pathlib import Path
import inspect
filename = Path(__file__).parent / 'src' / 'DAVE' / 'nds' / 'auto_generated_node_documentation.py'
# first clear the existing file
with open(filename,'w') as f:
f.write('')
import DAVE.scene as ds
from DAVE.helpers.generate_node_documentation import generate_python_code
clsmembers = inspect.getmembers(ds, inspect.isclass)
code = ['# This file is auto-generated by make_proplist.py',
'# DO NOT EDIT MANUALLY']
first = True
for cls_name, cls in clsmembers:
if not issubclass(cls, ds.DAVENodeBase): # Only report nodes and mixins
continue
code.extend(generate_python_code(cls, imports=first))
first = False
with open(filename,'w') as f:
f.write('\n'.join(code))