% for section, options in sorted(conf.items()): [${section}] % for key, value in sorted(options.items()): % if value is None: ${key} % else: ${key} = ${value} % endif % endfor % endfor