From 5358ee20cbe52470d875cfd60d9164b59ff2fa9b Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sat, 12 Mar 2022 15:43:10 +0100 Subject: [PATCH] linting --- dotdrop/cfg_yaml.py | 8 ++++---- scripts/yaml-to-toml.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dotdrop/cfg_yaml.py b/dotdrop/cfg_yaml.py index 4d7ec57..beca21c 100644 --- a/dotdrop/cfg_yaml.py +++ b/dotdrop/cfg_yaml.py @@ -1250,11 +1250,11 @@ class CfgYaml: @classmethod def _yaml_dump(cls, content, file, fmt='yaml'): """dump config file""" - if 'toml': + if fmt == 'toml': return cls.__toml_dump(content, file) - if 'yaml': - return cls.__yaml_dump(content, file) - raise YamlException("unsupported format") + if fmt == 'yaml': + return cls.__yaml_dump(content, file) + raise YamlException("unsupported format") @classmethod def __yaml_dump(cls, content, file): diff --git a/scripts/yaml-to-toml.py b/scripts/yaml-to-toml.py index 1922ab0..b315a3a 100755 --- a/scripts/yaml-to-toml.py +++ b/scripts/yaml-to-toml.py @@ -54,7 +54,6 @@ if __name__ == '__main__': path = sys.argv[1] content = yaml_load(path) - #print(content) content = replace_None(content) out = toml_dump(content) print(out)