diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-01-17 20:33:59 -0600 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-01-17 20:33:59 -0600 |
| commit | 73992f40045bf57dee8e0e171e3a65d4693a1362 (patch) | |
| tree | e0c9fdaf302afc5de1452c33a047ee816b4b84ae /config_file/config_file.py | |
| parent | Bump version: 0.3.0 → 0.3.1 (diff) | |
| parent | Remove _split_on_dot from base parser and add it to utils (diff) | |
| download | config-file-73992f40045bf57dee8e0e171e3a65d4693a1362.zip | |
Merge branch 'json'
Diffstat (limited to 'config_file/config_file.py')
| -rw-r--r-- | config_file/config_file.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/config_file/config_file.py b/config_file/config_file.py index c47def2..5a2dbb5 100644 --- a/config_file/config_file.py +++ b/config_file/config_file.py @@ -1,7 +1,9 @@ +import inspect from pathlib import Path from config_file.parsers.base_parser import BaseParser from config_file.parsers.ini_parser import IniParser +from config_file.utils import split_on_dot class ConfigFile: @@ -21,10 +23,10 @@ class ConfigFile: return Path(file_path) def __determine_parser(self, file_path: str, parser): - if isinstance(parser, BaseParser): + if isinstance(parser, BaseParser) and not inspect.isabstract(parser): return parser(self.contents) - file_type = self._split_on_dot(file_path, all_dots=True)[-1] + file_type = split_on_dot(file_path)[-1] if file_type == "ini": return IniParser(self.contents) else: |