Skip to content

Commit

Permalink
chore: satisfy mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Sep 17, 2023
1 parent 0403863 commit 74d1e42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions mknodes/templatenodes/mkpipdeptree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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__":
Expand Down
2 changes: 1 addition & 1 deletion mknodes/theme/mkgitblog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 74d1e42

Please sign in to comment.