1
0

refactor: refactor enum migration but not finished

This commit is contained in:
2026-01-26 22:52:56 +08:00
parent c68bdce37b
commit 9cb4d50f22
22 changed files with 669 additions and 54 deletions

View File

@@ -0,0 +1,14 @@
import enum
{% for benum in payload.iter_enums() %}
{%- if benum.get_enum_comment() is not none %}
/**
{{ benum.get_enum_comment() }}
*/
{%- endif %}
class {{ benum.get_enum_name() }}(enum.IntEnum):
{%- for entry in benum.iter_entries() %}
{{ entry.get_entry_name() }} = {% if entry.get_entry_value() is none -%} auto() {%- else -%} {{ entry.get_entry_value() }} {%- endif %} {%- if entry.get_entry_comment() is not none %}
"""{{ entry.get_entry_comment() }}""" {%- endif %}
{%- endfor %}
{%- endfor %}