2026-01-26 22:52:56 +08:00
|
|
|
import enum
|
|
|
|
|
|
|
|
|
|
{% for benum in payload.iter_enums() %}
|
2026-01-27 16:38:29 +08:00
|
|
|
class {{ benum.get_enum_name() }}(enum.IntEnum):
|
2026-01-26 22:52:56 +08:00
|
|
|
{%- if benum.get_enum_comment() is not none %}
|
2026-01-27 16:38:29 +08:00
|
|
|
"""
|
|
|
|
|
{{ benum.get_enum_comment() | block_comment('') }}
|
|
|
|
|
"""
|
2026-01-26 22:52:56 +08:00
|
|
|
{%- endif %}
|
|
|
|
|
{%- for entry in benum.iter_entries() %}
|
2026-01-27 16:38:29 +08:00
|
|
|
{{ entry.get_entry_name() }} = {% if entry.get_entry_value() is none -%} auto() {%- else -%} {{ utils.convert_to_python_number(entry.get_entry_value()) }} {%- endif %} {%- if entry.get_entry_comment() is not none %}
|
|
|
|
|
"""{{ entry.get_entry_comment() | line_comment }}""" {%- endif %}
|
2026-01-26 22:52:56 +08:00
|
|
|
{%- endfor %}
|
|
|
|
|
{%- endfor %}
|