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

setconfig: remove quotes from section names

parent 728ad88f
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@ Tools
* improve detection of model and build dirs
* support different generations of launch logic
* support stand-alone atmosphere scripts
* setconfig: remove quotes from section names (may be disabled)
Release 1.3.1
=============
......
......@@ -42,6 +42,8 @@ command_line.add_argument('--inline-comments' , '-c', action='store_true',
' (BETA)')
command_line.add_argument('--trailing-space' , '-t', action='store_true',
help='remove white space at end of lines')
command_line.add_argument('--keep-section-quotes', action='store_true',
help='do not remove quotes from section names')
args = command_line.parse_args()
......@@ -101,6 +103,7 @@ config_data.write(lines)
lines.seek(0)
for line in io.TextIOWrapper(lines):
if args.inline_comments: line = re.sub(r' = (.*?) #', r' = \1 #', line)
if not args.keep_section_quotes: line = re.sub(r'\["(.*?)"\]', r'[\1]', line)
if args.trailing_space:
print(line.rstrip())
else:
......
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