diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-02-02 14:32:59 -0600 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-02-02 14:32:59 -0600 |
| commit | df765605ad8295776e710afd305f848813ab0e43 (patch) | |
| tree | 9d38205653c83dbba880572216e63b6524b12e95 /config_file/config_file.py | |
| parent | Add type hints + contents is now content in BaseParser (diff) | |
| download | config-file-df765605ad8295776e710afd305f848813ab0e43.zip | |
Add working JSON parser
Diffstat (limited to 'config_file/config_file.py')
| -rw-r--r-- | config_file/config_file.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/config_file/config_file.py b/config_file/config_file.py index d5e23b6..d9f9a2e 100644 --- a/config_file/config_file.py +++ b/config_file/config_file.py @@ -4,6 +4,7 @@ from shutil import copyfile from config_file.parsers.base_parser import BaseParser from config_file.parsers.ini_parser import IniParser +from config_file.parsers.json_parser import JsonParser from config_file.utils import split_on_dot @@ -53,6 +54,8 @@ class ConfigFile: file_type = split_on_dot(file_path, only_last_dot=True)[-1] if file_type == "ini": return IniParser(self.contents) + elif file_type == "json": + return JsonParser(self.contents) else: raise ValueError( f"File path contains an unsupported or " |