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

Merged changes from /trunk/echam-dev/util/mkexp

* r3341: Changed comments in namelist to deal with inline comments and empty lines
parent e24b1f1a
No related branches found
No related tags found
No related merge requests found
......@@ -142,10 +142,15 @@ def format_namelist(section):
key = key.lower()
indent = base_indent + len(key) + 3
for line in contents.comments.get(key, []):
lines.write(' '*base_indent+re.sub(r'^#', '!', line)+
'\n')
if line:
lines.write(' '*base_indent+
re.sub(r'^#', '!', line)+'\n')
line = contents.inline_comments[key]
if not line:
line = ''
line = re.sub(r'^#', ' !', line)
lines.write(' '*base_indent+key+' = '+
format_value(value, indent)+'\n')
format_value(value, indent)+line+'\n')
lines.write('/\n')
return lines.getvalue()
......
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