Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 30, 2024
1 parent 9f0939a commit 0079b81
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions sphinx_needs/directives/list2need.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def presentation(argument: str) -> Any:
"links-down": directives.unchanged,
"tags": directives.unchanged,
"hide": directives.unchanged,
"meta-data": directives.unchanged
"meta-data": directives.unchanged,
}

def run(self) -> Sequence[nodes.Node]:
Expand Down Expand Up @@ -215,23 +215,20 @@ def run(self) -> Sequence[nodes.Node]:
hide_option = list_need["options"].get("hide", "")
list_need["options"]["hide"] = hide_option


if metadata:
if "options" not in list_need:
list_need["options"] = {}
metadata_items = re.findall(r'([^=,]+)=["\']([^"\']+)["\']', metadata)

for key, value in metadata_items:
current_options = list_need["options"].get(key.strip(), "")



if current_options:
list_need["options"][key.strip()] = current_options + "," + value
list_need["options"][key.strip()] = (
current_options + "," + value
)
else:
list_need["options"][key.strip()] = value



template = Template(NEED_TEMPLATE, autoescape=True)

Expand Down

0 comments on commit 0079b81

Please sign in to comment.