1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-22 04:43:00 +00:00

yml whitespace fix

This commit is contained in:
Jörn-Michael Miehe 2020-08-18 16:36:29 +02:00
parent e45d3ae83f
commit 301b505efa
2 changed files with 6 additions and 2 deletions

View file

@ -49,7 +49,10 @@ class Config:
"""dump into textual representation"""
# dump yml content
yml_string = yaml.dump(self.__yml_content, default_flow_style=False, sort_keys=False)
yml_string = yaml.dump(
self.__yml_content,
default_flow_style=False, sort_keys=False
).strip()
# insert newline before every main key
yml_string = re.sub(r'^(\S)', r'\n\1', yml_string, flags=re.MULTILINE)
@ -82,6 +85,7 @@ class Config:
with open(KIWI_CONF_NAME, 'w') as stream:
stream.write(str(self))
stream.write('\n')
class DefaultConfig(Config):