1
0

fix: finish enums migration

confirm project works as expected comparing before-refactor one.
This commit is contained in:
2026-01-27 17:23:58 +08:00
parent 0419dc3939
commit f601782370
4 changed files with 16 additions and 18 deletions

View File

@@ -3,12 +3,12 @@ import enum
{% for benum in payload.iter_enums() %}
class {{ benum.get_enum_name() }}(enum.IntEnum):
{%- if benum.get_enum_comment() is not none %}
"""
{{ benum.get_enum_comment() | block_comment('') }}
"""
"""
{{ benum.get_enum_comment() | block_comment(' ') }}
"""
{%- endif %}
{%- for entry in benum.iter_entries() %}
{{ 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_name() }} = {% if entry.get_entry_value() is none -%} auto() {%- else -%} {{ utils.to_py_num_literal(entry.get_entry_value()) }} {%- endif %} {%- if entry.get_entry_comment() is not none %}
"""{{ entry.get_entry_comment() | line_comment }}""" {%- endif %}
{%- endfor %}
{%- endfor %}