Corrected format templates. fixed #20
parent
76a49228f0
commit
d130e476aa
@ -1,27 +1,25 @@
|
||||
{% for item_name, item_value in document_dictionary.items() recursive %}
|
||||
{% if item_name != '#' %}
|
||||
{% if item_value is mapping %}
|
||||
{% if not loop.first %}
|
||||
|
||||
{% endif %}
|
||||
{% if '#' in item_value %}
|
||||
{% for comment in item_value['#'] %}
|
||||
{% for item_name, item_value in document_dictionary.items() recursive -%}
|
||||
{% if item_name != '#' -%}
|
||||
{% if item_value is mapping -%}
|
||||
{{ '' if loop.first else '\n' -}}
|
||||
{% if '#' in item_value -%}
|
||||
{% for comment in item_value['#'] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if item_name[1] == 'inet' %}
|
||||
{% endfor -%}
|
||||
{% endif -%}
|
||||
{% if item_name[1] == 'inet' -%}
|
||||
{{ item_name[0] + item_name[1:] | join(' ') }}
|
||||
{%- for keyword in item_value %}
|
||||
{%- if keyword != '#' %} {{ keyword[1] }} { {{ item_value[keyword] | join('; ')}}; }{% endif %}{% endfor %};
|
||||
{% else %}
|
||||
{%- for keyword in item_value -%}
|
||||
{%- if keyword != '#' %} {{ keyword[1] }} { {{ item_value[keyword] | join('; ')}}; }{% endif %}{% endfor -%};
|
||||
{% else -%}
|
||||
{{ item_name[0] + item_name[1:] | join(' ') }} {
|
||||
{{ loop(item_value.items()) | indent}}};
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% for comment in item_value[:-1] %}
|
||||
{% endif -%}
|
||||
{% else -%}
|
||||
{% for comment in item_value[:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
{{ item_name[0] + item_name[1:] | join(' ') }}{% if not item_value[-1] == '' %} {{ item_value[-1] }}{% endif%};
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
|
@ -1,17 +1,17 @@
|
||||
{% for section_name in document_dictionary.keys() %}
|
||||
{% if '#' in document_dictionary[section_name].keys() %}
|
||||
{% for comment in document_dictionary[section_name]['#'] %}
|
||||
{% for section_name in document_dictionary.keys() -%}
|
||||
{{ '' if loop.first else '\n' -}}
|
||||
{% if '#' in document_dictionary[section_name].keys() -%}
|
||||
{% for comment in document_dictionary[section_name]['#'] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor -%}
|
||||
{% endif -%}
|
||||
[{{ section_name | join('') }}]
|
||||
{% for parameter_name in document_dictionary[section_name].keys() %}
|
||||
{% if parameter_name != '#' %}
|
||||
{% for comment in document_dictionary[section_name][parameter_name][:-1]%}
|
||||
{% for parameter_name in document_dictionary[section_name].keys() -%}
|
||||
{% if parameter_name != '#' -%}
|
||||
{% for comment in document_dictionary[section_name][parameter_name][:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
{{ parameter_name | join('') }}={{ document_dictionary[section_name][parameter_name][-1] }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% endfor -%}
|
||||
|
@ -1,34 +1,28 @@
|
||||
{% for item_name, item_value in document_dictionary.items() recursive %}
|
||||
{% if item_name != '#' and item_name[1] != '!include' %}
|
||||
{% if item_value is mapping %}
|
||||
{% if '#' in item_value %}
|
||||
{% for comment in item_value['#'] %}
|
||||
{% for item_name, item_value in document_dictionary.items() recursive -%}
|
||||
{% if item_name != '#' and item_name[1] != '!include' -%}
|
||||
{% if item_value is mapping -%}
|
||||
{% if '#' in item_value -%}
|
||||
{% for comment in item_value['#'] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor -%}
|
||||
{% endif -%}
|
||||
{{ item_name[0] + item_name[1:] | join(' ') }} {
|
||||
{{ loop(item_value.items()) | indent}}}
|
||||
{% else %}
|
||||
{% for comment in item_value[:-1] %}
|
||||
{% else -%}
|
||||
{% for comment in item_value[:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
{{ item_name[0] + item_name[1:] | join(' ') }}{%- if not item_value[-1] == '' %} = {{ item_value[-1] }}
|
||||
{% else %}
|
||||
{%- if not loop.last%}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if not loop.last%}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% for item_name in document_dictionary.keys() %}
|
||||
{% if item_name[1] == '!include' %}
|
||||
{% else -%}
|
||||
{{ '' if loop.last else '\n' -}}
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
{{ '' if loop.last else '\n' -}}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% for item_name in document_dictionary.keys() -%}
|
||||
{% if item_name[1] == '!include' -%}
|
||||
{{ item_name[0] + item_name[1:] | join(' ') }}
|
||||
{% if not loop.last%}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ '' if loop.last else '\n' -}}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
|
@ -1,17 +1,17 @@
|
||||
{% for section_name in document_dictionary.keys() %}
|
||||
{% if '#' in document_dictionary[section_name].keys() %}
|
||||
{% for comment in document_dictionary[section_name]['#'] %}
|
||||
{% for section_name, section in document_dictionary.items() -%}
|
||||
{{ '' if loop.first else '\n' -}}
|
||||
{% if '#' in section.keys() -%}
|
||||
{% for comment in section['#'] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor -%}
|
||||
{% endif -%}
|
||||
[{{ section_name[0] + section_name[1:] | join('][') }}]
|
||||
{% for parameter_name in document_dictionary[section_name].keys() %}
|
||||
{% if parameter_name != '#' %}
|
||||
{% for comment in document_dictionary[section_name][parameter_name][:-1]%}
|
||||
{% for parameter_name, value in section.items() -%}
|
||||
{% if parameter_name != '#' -%}
|
||||
{% for comment in value[:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{{ parameter_name[0] + parameter_name[1] }}={{ document_dictionary[section_name][parameter_name][-1] }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
{{ parameter_name[0] + parameter_name[1] }}={{ value[-1] }}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% endfor -%}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{% for parameter_name in document_dictionary.keys() %}
|
||||
{% for comment in document_dictionary[parameter_name][:-1]%}
|
||||
{% for parameter_name in document_dictionary.keys() -%}
|
||||
{% for comment in document_dictionary[parameter_name][:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
{{ parameter_name[0] + parameter_name[1] }}={{ document_dictionary[parameter_name][-1] }}
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
|
@ -1,59 +1,56 @@
|
||||
{% for section_type in document_dictionary.keys() %}
|
||||
{% if '#' in document_dictionary[section_type] %}
|
||||
{% for comment in document_dictionary[section_type]['#']%}
|
||||
{% for section_type in document_dictionary.keys() -%}
|
||||
{{ '' if loop.first else '\n' -}}
|
||||
{% if '#' in document_dictionary[section_type] -%}
|
||||
{% for comment in document_dictionary[section_type]['#'] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if section_type != ('', 'global')%}
|
||||
{% endfor -%}
|
||||
{% endif -%}
|
||||
{% if section_type != ('', 'global') -%}
|
||||
{{ section_type[0] + section_type[1] }} {{ section_type[2] }}
|
||||
{% endif %}
|
||||
{% for directive in document_dictionary[section_type].keys() if directive[1] == 'include' %}
|
||||
{% for comment in document_dictionary[section_type][directive][:-1] %}
|
||||
{% endif -%}
|
||||
{% for directive in document_dictionary[section_type].keys() if directive[1] == 'include' -%}
|
||||
{% for comment in document_dictionary[section_type][directive][:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
{{ directive[0] + directive[1] }} {{ directive[2] }}
|
||||
{% endfor %}
|
||||
{% for directive in document_dictionary[section_type].keys() %}
|
||||
{% if directive != '#' and directive[1] != 'include' %}
|
||||
{% set directive_value = document_dictionary[section_type][directive] %}
|
||||
{% if directive[1] == 'access to' %}
|
||||
{% set access_values = directive_value.keys()|list %}
|
||||
{% if '#' in directive_value %}
|
||||
{% for comment in directive_value['#'] %}
|
||||
{% endfor -%}
|
||||
{% for directive in document_dictionary[section_type].keys() -%}
|
||||
{% if directive != '#' and directive[1] != 'include' -%}
|
||||
{% set directive_value = document_dictionary[section_type][directive] -%}
|
||||
{% if directive[1] == 'access to' -%}
|
||||
{% set access_values = directive_value.keys()|list -%}
|
||||
{% if '#' in directive_value -%}
|
||||
{% for comment in directive_value['#'] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% set access_values = access_values[1:] %}
|
||||
{% endif %}
|
||||
{% if access_values|length == 1 %}
|
||||
{% endfor -%}
|
||||
{% set access_values = access_values[1:] -%}
|
||||
{% endif -%}
|
||||
{% if access_values|length == 1 -%}
|
||||
{{ directive[0] + directive[1] }} {{ directive[2] }} by {{ access_values[0][1] }} {{ directive_value[access_values[0]][0] }}
|
||||
{% else %}
|
||||
{% else -%}
|
||||
{{ directive[0] + directive[1] }} {{ directive[2] }}
|
||||
{% for value in access_values|reverse %}
|
||||
by {{ value[0] + value[1] }} {{ directive_value[value][0] }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% elif directive[1] == 'syncrepl' %}
|
||||
{% set syncrepl_values = directive_value.keys()|list%}
|
||||
{% if '#' in directive_value %}
|
||||
{% for comment in directive_value['#'] %}
|
||||
{% for value in access_values|reverse -%}
|
||||
{{ ' by ' + value[0] + value[1] }} {{ directive_value[value][0] }}
|
||||
{% endfor -%}
|
||||
{% endif -%}
|
||||
{% elif directive[1] == 'syncrepl' -%}
|
||||
{% set syncrepl_values = directive_value.keys()|list -%}
|
||||
{% if '#' in directive_value -%}
|
||||
{% for comment in directive_value['#'] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% set syncrepl_values = syncrepl_values[1:]%}
|
||||
{% endif %}
|
||||
{% endfor -%}
|
||||
{% set syncrepl_values = syncrepl_values[1:] -%}
|
||||
{% endif -%}
|
||||
{{ directive[0] + directive[1] }} {{ directive[2] }}
|
||||
{% for value in syncrepl_values %}
|
||||
{{ value[0] + value[1] }}={{ directive_value[value][0] }}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for comment in directive_value[:-1] %}
|
||||
{% for value in syncrepl_values -%}
|
||||
{{ ' ' + value[0] + value[1] }}={{ directive_value[value][0] }}
|
||||
{% endfor -%}
|
||||
{% else -%}
|
||||
{% for comment in directive_value[:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{{ directive[0] + directive[1:]|join(' ') }}{% if directive_value[-1] != '' %} {{ directive_value[-1] }}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
{{ directive[0] + directive[1:]|join(' ') }}{{ ' ' + directive_value[-1] if directive_value[-1] else '' }}
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% endfor -%}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% for parameter_name in document_dictionary.keys() %}
|
||||
{% for comment in document_dictionary[parameter_name][:-1]%}
|
||||
{% for parameter_name in document_dictionary.keys() -%}
|
||||
{% for comment in document_dictionary[parameter_name][:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{{ parameter_name[0] + parameter_name[1] }}={{ document_dictionary[parameter_name][-1] }}
|
||||
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
{{ parameter_name[0] + parameter_name[1] }}={{ document_dictionary[parameter_name][-1] -}}
|
||||
{{ '\n' if loop.last else '\n\n' -}}
|
||||
{% endfor -%}
|
||||
|
@ -1,8 +1,7 @@
|
||||
{% for parameter_name in document_dictionary.keys() %}
|
||||
{% for comment in document_dictionary[parameter_name][:-1]%}
|
||||
{% for parameter_name in document_dictionary.keys() -%}
|
||||
{% for comment in document_dictionary[parameter_name][:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{{ parameter_name[0] + parameter_name[1] }} = {{ document_dictionary[parameter_name][-1] }}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endfor -%}
|
||||
{{ parameter_name[0] + parameter_name[1] }} = {{ document_dictionary[parameter_name][-1] -}}
|
||||
{{ '\n' if loop.last else '\n\n' -}}
|
||||
{% endfor -%}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% for parameter_name in document_dictionary.keys() %}
|
||||
{% for comment in document_dictionary[parameter_name][:-1]%}
|
||||
{% for parameter_name in document_dictionary.keys() -%}
|
||||
{% for comment in document_dictionary[parameter_name][:-1] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{{ parameter_name[0] + parameter_name[1] }}={{ document_dictionary[parameter_name][-1] }}
|
||||
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
{{ parameter_name[0] + parameter_name[1] }}={{ document_dictionary[parameter_name][-1] -}}
|
||||
{{ '\n' if loop.last else '\n\n' -}}
|
||||
{% endfor -%}
|
||||
|
@ -1,16 +1,16 @@
|
||||
{% for section_name in document_dictionary.keys() %}
|
||||
{% if '#' in document_dictionary[section_name].keys() %}
|
||||
{% for comment in document_dictionary[section_name]['#'] %}
|
||||
{% for section_name in document_dictionary.keys() -%}
|
||||
{% if '#' in document_dictionary[section_name].keys() -%}
|
||||
{% for comment in document_dictionary[section_name]['#'] -%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor -%}
|
||||
{% endif -%}
|
||||
[{{ section_name | join('') }}]
|
||||
{% for parameter_name in document_dictionary[section_name].keys() %}
|
||||
{% if parameter_name != '#' %}
|
||||
{% for comment in document_dictionary[section_name][parameter_name][:-1]%}
|
||||
{{ comment }}
|
||||
{% endfor %}
|
||||
{{ parameter_name | join('') }} = {{ document_dictionary[section_name][parameter_name][-1] }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% for parameter_name in document_dictionary[section_name].keys() -%}
|
||||
{% if parameter_name != '#' -%}
|
||||
{% for comment in document_dictionary[section_name][parameter_name][:-1] -%}
|
||||
{{ " " + comment }}
|
||||
{% endfor -%}
|
||||
{{ " " + parameter_name | join('') }} = {{ document_dictionary[section_name][parameter_name][-1] }}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% endfor -%}
|
||||
|
Loading…
Reference in new issue