Skip to content
Snippets Groups Projects
Commit db4e0f06 authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

Config: fix whitespace handling in job namelists

parent 3bc4572e
No related tags found
No related merge requests found
...@@ -285,14 +285,18 @@ class ExpConfig(ConfigObj): ...@@ -285,14 +285,18 @@ class ExpConfig(ConfigObj):
current.rename(subkey_orig, subkey) current.rename(subkey_orig, subkey)
if 'namelists' in config.sections: if 'namelists' in config.sections:
for group in config['namelists'].sections: namelists = config['namelists']
unify_key(config['namelists'][group]) for group in namelists.sections:
unify_key(namelists[group])
if 'jobs' in config.sections: if 'jobs' in config.sections:
unify_key(config['jobs']) jobs = config['jobs']
for job in config['jobs'].sections: unify_key(jobs)
if 'namelists' in config['jobs'][job].sections: for name in jobs.sections:
for group in config['namelists'].sections: job = jobs[name]
unify_key(config['jobs'][job]['namelists'][group]) if 'namelists' in job.sections:
namelists = job['namelists']
for group in namelists.sections:
unify_key(namelists[group])
# Helper functions for value definitions # Helper functions for value definitions
......
...@@ -644,12 +644,18 @@ class NamelistTestCase(MkexpSimpleTestCase): ...@@ -644,12 +644,18 @@ class NamelistTestCase(MkexpSimpleTestCase):
/ /
&group ! 'i i i' &group ! 'i i i'
/ /
&group ! '3 a'
/
""", u""" """, u"""
[namelists] [namelists]
[[namelist]] [[namelist]]
[[[group 1]]] [[[group 1]]]
[[[group 2]]] [[[group 2]]]
[[[group i i i]]] [[[group i i i]]]
""", u"""
[[[namelists]]]
[[[[namelist]]]]
[[[[[ group 3 a\t ]]]]]
""") """)
def test_namelist_case_twist(self): def test_namelist_case_twist(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment