add spaces and case for bool values

This commit is contained in:
psy 2021-01-29 15:15:56 +01:00
parent cc8409ab9c
commit b46012bf7a
No known key found for this signature in database
GPG key ID: DFF5B17AC3A8ECF5

View file

@ -1,6 +1,8 @@
{%- macro keyvalue(key, value, depth=0) %} {%- macro keyvalue(key, value, depth=0) %}
{%- if value is string -%} {%- if value is string -%}
{{ key }}="{{ value }}"; {{ key }} = "{{ value }}";
{%- elif value is boolean -%}
{{ key }} = {{ value|lower }};
{%- elif value is mapping -%} {%- elif value is mapping -%}
{{ key }} { {{ key }} {
{% for key, value in value.items() %} {% for key, value in value.items() %}
@ -8,7 +10,7 @@
{% endfor -%} {% endfor -%}
} }
{%- elif value is iterable and (value is not string and value is not mapping) -%} {%- elif value is iterable and (value is not string and value is not mapping) -%}
{{ key }}=["{{ value|join('", "') }}"]; {{ key }} = ["{{ value|join('", "') }}"];
{%- endif -%} {%- endif -%}
{% endmacro -%} {% endmacro -%}