From 7819f6fceb37d1b2f20e7320c373b2319acd9e38 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Thu, 4 Jul 2019 15:48:14 +0200 Subject: [PATCH] Fixed problem with non-str values for config parser Signed-off-by: Jim Martens --- src/twomartens/masterthesis/config.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/twomartens/masterthesis/config.py b/src/twomartens/masterthesis/config.py index 31d48b4..1cda959 100644 --- a/src/twomartens/masterthesis/config.py +++ b/src/twomartens/masterthesis/config.py @@ -44,8 +44,8 @@ _CONFIG_PROPS = { "weights": (str, "") }, "Debug": { - "summaries": (bool, True), - "train_images": (bool, False) + "summaries": (bool, "True"), + "train_images": (bool, "False") } } @@ -58,7 +58,7 @@ def get_property(key: str) -> str: parser.read(config_file) section, prop = tuple(key.split(".")) - return str(parser.get(section, prop)) + return parser.get(section, prop) def set_property(key: str, value: str) -> None: @@ -69,8 +69,7 @@ def set_property(key: str, value: str) -> None: parser.read(config_file) section, prop = tuple(key.split(".")) - cast_method = _CONFIG_PROPS[section][key][0] - parser.set(section, prop, cast_method(value)) + parser.set(section, prop, value) def list_property_values() -> None: