diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-02-02 14:21:02 -0600 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-02-02 14:21:02 -0600 |
| commit | 592ea6812da05ec49a7428862309e078704bc740 (patch) | |
| tree | c200a4924bcfd3cb83997c4aa4dc83c9cf7c8f41 /config_file/parsers/base_parser.py | |
| parent | Add ability to parse values in list to native types (diff) | |
| download | config-file-592ea6812da05ec49a7428862309e078704bc740.zip | |
Add type hints + contents is now content in BaseParser
Diffstat (limited to 'config_file/parsers/base_parser.py')
| -rw-r--r-- | config_file/parsers/base_parser.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/config_file/parsers/base_parser.py b/config_file/parsers/base_parser.py index 22e286a..54756cd 100644 --- a/config_file/parsers/base_parser.py +++ b/config_file/parsers/base_parser.py @@ -21,8 +21,8 @@ class BaseParser(ABC): It is up to the caller of the parser to read in the file to the parser and save the file when they are done using stringify(). """ - self.contents = file_contents - self.parsed_content = self.parse(self.contents) + self.content = file_contents + self.parsed_content = self.parse(self.content) @abstractmethod def get(self, key, parse_type=True): @@ -37,12 +37,12 @@ class BaseParser(ABC): raise NotImplementedError @abstractmethod - def set(self, key, value): + def set(self, key, value) -> bool: """Sets the value of a key.""" raise NotImplementedError @abstractmethod - def delete(self, section_key): + def delete(self, section_key) -> bool: """Deletes a key/value pair or entire sections.""" raise NotImplementedError |