From 10d945ed28efcbb0b3bb8f476890258221759dca Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 7 Feb 2022 13:58:07 +0000 Subject: [PATCH] add enums for raygui, issue #52 --- create_enums.py | 19 +- docs/genindex.html | 2704 +++++++------- docs/objects.inv | Bin 14556 -> 15792 bytes docs/pyray.html | 6715 ++++++++++++++++++++--------------- docs/searchindex.js | 2 +- make_docs.sh | 2 +- pyray/__init__.pyi | 367 ++ raylib/enums.py | 367 ++ tests/test_pyray.py | 2 +- tests/xtest_raygui_pyray.py | 3 + version.py | 2 +- 11 files changed, 6019 insertions(+), 4164 deletions(-) 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