diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-02-02 16:01:46 -0600 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-02-02 16:01:46 -0600 |
| commit | 2430b011145d5af4eb34f79c1ad7f793f07eeba3 (patch) | |
| tree | f7877f1e3c07471b1d74ae8ff8e3e4671c25ee04 /config_file | |
| parent | Change install name (diff) | |
| download | config-file-2430b011145d5af4eb34f79c1ad7f793f07eeba3.zip | |
Add sphinx-quickstart
Diffstat (limited to 'config_file')
| -rw-r--r-- | config_file/parsers/ini_parser.py | 3 | ||||
| -rw-r--r-- | config_file/parsers/json_parser.py | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/config_file/parsers/ini_parser.py b/config_file/parsers/ini_parser.py index 93f239c..ba44c64 100644 --- a/config_file/parsers/ini_parser.py +++ b/config_file/parsers/ini_parser.py @@ -61,10 +61,12 @@ class IniParser(BaseParser): to it. :param section_key: The key to set from the config file. e.g. 'section1.key' + :param value: The value to set the key to. It can be any type that can be converted to a string. :return: True if the setting was successful. + :raises ValueError: If there is no dot (.) in section_key """ section, key = split_on_dot(section_key, only_last_dot=True) @@ -87,7 +89,6 @@ class IniParser(BaseParser): to delete the entire section. :return: True if the deletion succeeded. - :rtype: boolean :raise ValueError: If the section or key does not exist in the config file. """ diff --git a/config_file/parsers/json_parser.py b/config_file/parsers/json_parser.py index 344ae7f..8e4617b 100644 --- a/config_file/parsers/json_parser.py +++ b/config_file/parsers/json_parser.py @@ -61,7 +61,9 @@ class JsonParser(BaseParser): Retrieve values using a dot syntax. :param key: The key to retrieve. e.g. 'foo.bar.boo' + :param parse_type: Whether you'd like the type parsed into its native one. + :param retrieve_all: Specify whether you'd like to recursively receive all values that match the given key. Returned as a list. e.g. 'foo' would retrieve all values that have the key 'foo', anywhere |