File tree 1 file changed +4
-9
lines changed
scripts/semconv/templates
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 16
16
17
17
# pylint: disable=too-many-lines
18
18
19
- {% - macro print_value (type , value ) -%}
20
- {{ "\"" if type == "string"}}{{value}}{{ "\"" if type == "string"}}
21
- {% - endmacro %}
22
-
23
- {% - set enum_attributes = filtered_attributes | selectattr ("is_enum" , "true" ) | list %}
24
- {% - if enum_attributes | count > 0 %}
19
+ {% - set filtered_enum_attributes = enum_attributes | select (filter ) | list %}
20
+ {% - if filtered_enum_attributes | count > 0 %}
25
21
26
22
from enum import Enum
27
23
{% - endif %}
@@ -46,12 +42,11 @@ Deprecated: {{attribute.deprecated | to_doc_brief}}.
46
42
{% - endfor %}
47
43
{# Extra line #}
48
44
{# Extra line #}
49
- {% - for attribute in enum_attributes %}
45
+ {% - for attribute in filtered_enum_attributes %}
50
46
{% - set class_name = attribute .fqn | to_camelcase (True ) ~ "Values" %}
51
- {% - set type = attribute .attr_type .enum_type %}
52
47
class {{class_name}}(Enum):
53
48
{% - for member in attribute .attr_type .members %}
54
- {{ member.member_id | to_const_name }} = {{ print_value(type, member.value ) }}
49
+ {{ member.member_id | to_const_name }} = {{ attribute | print_member_value( member) }}
55
50
"""{{member.brief | to_doc_brief}}."""
56
51
{# Extra line #}
57
52
{% - endfor %}
You can’t perform that action at this time.
0 commit comments