From 74d1e42083a3ea48d52b50589c2a82f5b9170f71 Mon Sep 17 00:00:00 2001 From: Philipp Temminghoff Date: Sun, 17 Sep 2023 15:26:17 +0200 Subject: [PATCH] chore: satisfy mypy --- mknodes/templatenodes/mkpipdeptree.py | 9 +++++---- mknodes/theme/mkgitblog.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mknodes/templatenodes/mkpipdeptree.py b/mknodes/templatenodes/mkpipdeptree.py index e2feabf3..b8aa2a34 100644 --- a/mknodes/templatenodes/mkpipdeptree.py +++ b/mknodes/templatenodes/mkpipdeptree.py @@ -37,7 +37,9 @@ def get_mermaid( exclude_list = set(exclude.split(",")) if exclude else None if show_only is not None or exclude_list is not None: tree = tree.filter_nodes(show_only, exclude_list) - return render_mermaid(tree) + tree = [tree] if isinstance(tree, str) else tree + text = render_mermaid(tree) + return "\n".join(text.splitlines()[1:]) class MkPipDepTree(mkdiagram.MkDiagram): @@ -97,12 +99,11 @@ def package(self): @property def mermaid_code(self) -> str: - mm = get_mermaid( - package=self.package, + return get_mermaid( + self.package, local_only=self.local_only, user_only=self.user_only, ) - return "\n".join(mm.splitlines()[1:]) if __name__ == "__main__": diff --git a/mknodes/theme/mkgitblog.py b/mknodes/theme/mkgitblog.py index 2d5c1ca5..7a66d38b 100644 --- a/mknodes/theme/mkgitblog.py +++ b/mknodes/theme/mkgitblog.py @@ -95,6 +95,6 @@ def add_commits(self): if __name__ == "__main__": blog = MkGitBlog("phil65", "mknodes", "blog/posts") blog.add_commits() - page = blog.pages[1] + page = blog.nav.pages[1] print(page)