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:
parent
e45d3ae83f
commit
301b505efa
2 changed files with 6 additions and 2 deletions
|
@ -7,7 +7,7 @@ version: '0.1'
|
||||||
runtime:
|
runtime:
|
||||||
storage: /tmp/kiwi
|
storage: /tmp/kiwi
|
||||||
shells:
|
shells:
|
||||||
- /bin/bash
|
- /bin/bash
|
||||||
env: null
|
env: null
|
||||||
|
|
||||||
markers:
|
markers:
|
||||||
|
|
|
@ -49,7 +49,10 @@ class Config:
|
||||||
"""dump into textual representation"""
|
"""dump into textual representation"""
|
||||||
|
|
||||||
# dump yml content
|
# 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
|
# insert newline before every main key
|
||||||
yml_string = re.sub(r'^(\S)', r'\n\1', yml_string, flags=re.MULTILINE)
|
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:
|
with open(KIWI_CONF_NAME, 'w') as stream:
|
||||||
stream.write(str(self))
|
stream.write(str(self))
|
||||||
|
stream.write('\n')
|
||||||
|
|
||||||
|
|
||||||
class DefaultConfig(Config):
|
class DefaultConfig(Config):
|
||||||
|
|
Loading…
Reference in a new issue