From 0930821d406a5a9be7feef76517b7658bc51196d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20W=C3=BChr?= Date: Tue, 20 Feb 2024 13:46:00 +0100 Subject: [PATCH] Allow other types than "file" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Florian Wühr --- doorstop/core/item.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doorstop/core/item.py b/doorstop/core/item.py index 04aae6971..2e52fe2d3 100644 --- a/doorstop/core/item.py +++ b/doorstop/core/item.py @@ -358,7 +358,11 @@ def _yaml_data(self, textattributekeys=None): continue stripped_value = [] for el in value: - ref_dict = {"path": el["path"].strip(), "type": "file"} # type: ignore + if isinstance(el, dict) and "type" in el: + type_stripped = el["type"].strip() + else: + type_stripped = "file" + ref_dict = {"path": el["path"].strip(), "type": type_stripped} # type: ignore if "keyword" in el: ref_dict["keyword"] = el["keyword"] # type: ignore