From 0a050abb746a3578631881f72ca14670822f44c8 Mon Sep 17 00:00:00 2001 From: katharinahafner <70482360+katharinahafner@users.noreply.github.com> Date: Tue, 7 Jun 2022 11:31:10 +0200 Subject: [PATCH 1/2] Parse yaml directories as key=value pairs Fix #258 --- configargparse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configargparse.py b/configargparse.py index b447396..cf02479 100644 --- a/configargparse.py +++ b/configargparse.py @@ -316,6 +316,8 @@ def parse(self, stream): for key, value in parsed_obj.items(): if isinstance(value, list): result[key] = value + elif isinstance(value, dict): + result[key] = value elif value is None: pass else: From 3e9f8242d0d90d7226d06b441c8d297137ae5ca5 Mon Sep 17 00:00:00 2001 From: katharinahafner <70482360+katharinahafner@users.noreply.github.com> Date: Tue, 7 Jun 2022 14:23:18 +0200 Subject: [PATCH 2/2] Bug Fix --- configargparse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configargparse.py b/configargparse.py index cf02479..8a39ed6 100644 --- a/configargparse.py +++ b/configargparse.py @@ -839,6 +839,8 @@ def convert_item_to_command_line_arg(self, action, key, value): "to 'append' or nargs is set to '*', '+', or > 1") % (key, value)) elif isinstance(value, str): args.append( "%s=%s" % (command_line_key, value) ) + elif isinstance(value, dict): + args.append( "%s=%s" % (command_line_key, value) ) else: raise ValueError("Unexpected value type {} for value: {}".format( type(value), value))