mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
validators, tests
This commit is contained in:
@@ -44,17 +44,17 @@ def _inner_make_dump(config: Section, _level: int=0) -> List[str]:
|
||||
for (key, value) in sorted(config.items(), key=operator.itemgetter(0)):
|
||||
indent = " " * _INDENT * _level
|
||||
if isinstance(value, Section):
|
||||
lines.append("{}{}:".format(indent, key))
|
||||
lines.append("%s%s:" % (indent, key))
|
||||
lines += _inner_make_dump(value, _level + 1)
|
||||
lines.append("")
|
||||
else:
|
||||
default = config._get_default(key) # pylint: disable=protected-access
|
||||
comment = config._get_help(key) # pylint: disable=protected-access
|
||||
if default == value:
|
||||
lines.append("{}{}: {} # {}".format(indent, key, _make_yaml(value, _level), comment))
|
||||
lines.append("%s%s: %s # %s" % (indent, key, _make_yaml(value, _level), comment))
|
||||
else:
|
||||
lines.append("{}# {}: {} # {}".format(indent, key, _make_yaml(default, _level), comment))
|
||||
lines.append("{}{}: {}".format(indent, key, _make_yaml(value, _level)))
|
||||
lines.append("%s# %s: %s # %s" % (indent, key, _make_yaml(default, _level), comment))
|
||||
lines.append("%s%s: %s" % (indent, key, _make_yaml(value, _level)))
|
||||
return lines
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user