diff --git a/create_enums.py b/create_enums.py index 38cb1ce..ae3b752 100644 --- a/create_enums.py +++ b/create_enums.py @@ -17,15 +17,20 @@ from raylib import rl, ffi from inspect import ismethod, getmembers, isbuiltin import inflection, sys, json -f = open("raylib.json", "r") -js = json.load(f) +def process(filename): + f = open(filename, "r") + js = json.load(f) + + for e in js['enums']: + if e['name'] and e['values']: + print ("class "+e['name']+"("+"IntEnum):") + for value in e['values']: + print(" "+value['name']+" = "+str(value['value'])) + print("") print("""from enum import IntEnum """) -for e in js['enums']: - print ("class "+e['name']+"("+"IntEnum):") - for value in e['values']: - print(" "+value['name']+" = "+str(value['value'])) - print("") +process("raylib.json") +process("raygui.json") diff --git a/docs/genindex.html b/docs/genindex.html index e3cf8bf..c54d071 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -106,24 +106,24 @@

A