mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -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}:"
|
||||
|
||||
Reference in New Issue
Block a user