Skip to content

Commit 10d945e

Browse files
add enums for raygui, issue #52
1 parent 2c752b5 commit 10d945e

File tree

11 files changed

+5696
-3841
lines changed

11 files changed

+5696
-3841
lines changed

create_enums.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,20 @@
1717
from inspect import ismethod, getmembers, isbuiltin
1818
import inflection, sys, json
1919

20-
f = open("raylib.json", "r")
21-
js = json.load(f)
20+
def process(filename):
21+
f = open(filename, "r")
22+
js = json.load(f)
23+
24+
for e in js['enums']:
25+
if e['name'] and e['values']:
26+
print ("class "+e['name']+"("+"IntEnum):")
27+
for value in e['values']:
28+
print(" "+value['name']+" = "+str(value['value']))
29+
print("")
2230

2331
print("""from enum import IntEnum
2432
""")
2533

26-
for e in js['enums']:
27-
print ("class "+e['name']+"("+"IntEnum):")
28-
for value in e['values']:
29-
print(" "+value['name']+" = "+str(value['value']))
30-
print("")
34+
process("raylib.json")
35+
process("raygui.json")
3136

docs/genindex.html

Lines changed: 1491 additions & 1401 deletions
Large diffs are not rendered by default.

docs/objects.inv

1.21 KB
Binary file not shown.

docs/pyray.html

Lines changed: 3452 additions & 2429 deletions
Large diffs are not rendered by default.

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

make_docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ gcc raylib-c/parser/raylib_parser.c
88
python3 raylib/build.py
99

1010
python3 create_enums.py > raylib/enums.py
11-
11+
python3 create_enums.py > dynamic/raylib/enums.py
1212

1313
pip3 install sphinx-autoapi myst_parser sphinx_rtd_theme
1414
python3 create_stub_pyray.py > pyray/__init__.pyi

0 commit comments

Comments
 (0)