diff options
author | Devaev Maxim <[email protected]> | 2020-09-10 07:30:25 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-09-10 07:30:25 +0300 |
commit | 967afb2d9a0f4a94026ec612801b6291db5c6a72 (patch) | |
tree | 70823828e4a3f215e055df5b8cda36c0adbed691 /kvmd/yamlconf | |
parent | a6385cd20e4c4119d9679ed6a58fd9e302d10efe (diff) |
refactoring
Diffstat (limited to 'kvmd/yamlconf')
-rw-r--r-- | kvmd/yamlconf/dumper.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/yamlconf/dumper.py b/kvmd/yamlconf/dumper.py index b0a561e5..ffc5fc38 100644 --- a/kvmd/yamlconf/dumper.py +++ b/kvmd/yamlconf/dumper.py @@ -21,13 +21,14 @@ import textwrap -import operator from typing import Generator from typing import Any import yaml +from .. import tools + from . import Section @@ -37,7 +38,7 @@ def make_config_dump(config: Section, indent: int=4) -> str: def _inner_make_dump(config: Section, indent: int, _level: int=0) -> Generator[str, None, None]: - for (key, value) in sorted(config.items(), key=operator.itemgetter(0)): + for (key, value) in tools.sorted_kvs(config): if isinstance(value, Section): prefix = " " * indent * _level yield f"{prefix}{key}:" |