20 lines
576 B
Django/Jinja
20 lines
576 B
Django/Jinja
# Generated by AIF-NG.
|
|
{%- for section_name, section_items in cfg.items() %}
|
|
{%- if section_items|isList %}
|
|
{#- We *only* use lists-of-dicts because they should always render to their own sections.
|
|
INI doesn't support nesting, thankfully. #}
|
|
{%- for i in section_items %}
|
|
[{{ section_name }}]
|
|
{%- for k, v in i.items() %}
|
|
{{ k }}={{ v }}
|
|
{%- endfor %}
|
|
{% endfor %}
|
|
{%- else %}
|
|
{#- It's a single-level dict. #}
|
|
[{{ section_name }}]
|
|
{%- for k, v in section_items.items() %}
|
|
{{ k }}={{ v }}
|
|
{%- endfor %}
|
|
{%- endif %}
|
|
{% endfor %}
|