diff --git a/CHANGELOG.md b/CHANGELOG.md index 03afb6a41ea875dbc9dceebc15cf5484b193b7ab..fc480143e7b08f88761456c28f39fa4f53c4c50d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `auth_token` if new value is `None` * [#119](https://gitlab.com/linkahead/linkahead-pylib/-/issues/119) The diff returned by compare_entities now uses id instead of name as key if either property does not have a name +* [#127](https://gitlab.com/linkahead/linkahead-pylib/-/issues/127) + pylinkahead.ini now supports None and tuples as values for the `timeout` keyword ### Security ### diff --git a/src/linkahead/configuration.py b/src/linkahead/configuration.py index e11749fbc9ef768b1a4ffa60364ac898ab9391e8..a87aca4ff01aad3d5b9add743ba8a0dc7f37b41a 100644 --- a/src/linkahead/configuration.py +++ b/src/linkahead/configuration.py @@ -90,10 +90,12 @@ def config_to_yaml(config: ConfigParser) -> dict[str, dict[str, Union[int, str, if key in ["debug"]: valobj[s][key] = int(value) elif key in ["timeout"]: + value = "".join(value.split()) # Remove whitespace if str(value).lower() in ["none", "null"]: valobj[s][key] = None elif value.startswith('(') and value.endswith(')'): - content = [int(s) for s in value[1:-1].split(',')] + content = [None if str(s).lower() in ["none", "null"] else int(s) + for s in value[1:-1].split(',')] valobj[s][key] = tuple(content) else: valobj[s][key] = int(value)