diff options
Diffstat (limited to 'config_file/parsers/abstract_parser.py')
| -rw-r--r-- | config_file/parsers/abstract_parser.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/config_file/parsers/abstract_parser.py b/config_file/parsers/abstract_parser.py index da6e90a..8f1bee1 100644 --- a/config_file/parsers/abstract_parser.py +++ b/config_file/parsers/abstract_parser.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from typing import Any -class BaseParser(ABC): +class AbstractParser(ABC): """ The abstract base parser for all other parsers to implement. @@ -26,6 +26,14 @@ class BaseParser(ABC): self.parsed_content = self.parse(self.content) @abstractmethod + def parse(self, file_contents: str) -> Any: + """ + Parse the file_contents into an internal representation + the given parser can work with. + """ + raise NotImplementedError + + @abstractmethod def get(self, key: str, parse_types: bool = False, all: bool = False) -> Any: """ Retrieve the value of a key in its native type. @@ -62,14 +70,6 @@ class BaseParser(ABC): using a section.key format. Some formats, like JSON, do not have sections and therefore, - it would only be checking if - """ - raise NotImplementedError - - @abstractmethod - def parse(self, file_contents: str) -> Any: - """ - Parse the file_contents into an internal representation - the given parser can work with. + it would only be checking if a certain key exists. """ raise NotImplementedError |