-
-
Notifications
You must be signed in to change notification settings - Fork 435
Expand file tree
/
Copy pathEnum.jinja2
More file actions
21 lines (19 loc) · 563 Bytes
/
Enum.jinja2
File metadata and controls
21 lines (19 loc) · 563 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{% for decorator in decorators -%}
{{ decorator }}
{% endfor -%}
class {{ class_name }}({{ base_class }}):
{%- if description %}
{{ description | format_docstring(4) }}
{%- endif %}
{%- for field in fields %}
{{ field.name }} = {{ field.default }}
{%- if field.docstring %}
{{ field.docstring | format_docstring(4) }}
{%- if field.use_inline_field_description and not loop.last %}
{% endif %}
{%- elif field.inline_field_docstring %}
{{ field.inline_field_docstring }}
{%- if not loop.last %}
{% endif %}
{%- endif %}
{%- endfor -%}