Skip to content

Commit

Permalink
chore: typing
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 16, 2024
1 parent db038b2 commit 04c8315
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion mknodes/basenodes/mkbasetable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def items(self, data):

def add_row(
self,
row: Sequence[str | None | mk.MkNode] | dict[str, str | None],
row: Sequence[str | mk.MkNode | None] | dict[str, str | None],
):
if len(row) != len(self.columns):
msg = "Row to add doesnt have same length as header"
Expand Down
2 changes: 1 addition & 1 deletion mknodes/basenodes/mkclidoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MkCliDoc(mktemplate.MkTemplate):

def __init__(
self,
target: str | None | argparse.ArgumentParser = None,
target: str | argparse.ArgumentParser | None = None,
*,
prog_name: str | None = None,
show_hidden: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion mknodes/basenodes/mkcontainer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MkContainer(mknode.MkNode):

def __init__(
self,
content: list | None | str | mknode.MkNode = None,
content: list | str | mknode.MkNode | None = None,
*,
block_separator: str = "\n\n",
**kwargs: Any,
Expand Down
2 changes: 1 addition & 1 deletion mknodes/basenodes/mkdefinitionlist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MkDefinition(mkcontainer.MkContainer):

def __init__(
self,
content: list | None | str | mknode.MkNode = None,
content: list | str | mknode.MkNode | None = None,
title: str = "",
**kwargs: Any,
):
Expand Down
2 changes: 1 addition & 1 deletion mknodes/basenodes/mkprogressbar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(
self,
percentage: int,
*,
label: str | None | Literal[True] = True,
label: str | Literal[True] | None = True,
style: Literal["thin", "candystripe", "candystripe_animated"] | None = None,
**kwargs: Any,
):
Expand Down
4 changes: 2 additions & 2 deletions mknodes/basenodes/mktasklist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MkTask(mkcontainer.MkContainer):
def __init__(
self,
value: bool = False,
content: list | None | str | mknode.MkNode = None,
content: list | str | mknode.MkNode | None = None,
**kwargs: Any,
):
"""Constructor.
Expand All @@ -47,7 +47,7 @@ class MkTaskList(mkcontainer.MkContainer):

def __init__(
self,
content: list | None | str | mknode.MkNode = None,
content: list | str | mknode.MkNode | None = None,
**kwargs: Any,
):
"""Constructor.
Expand Down
3 changes: 2 additions & 1 deletion mknodes/jinja/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,5 @@ def script_tag(context: runtime.Context, extra_script):
if extra_script.async_:
html += " async"
html += "></script>"
return Markup(html).format(url(context, str(extra_script)), extra_script)
string = url(context, str(extra_script))
return Markup(html).format(string, extra_script)
4 changes: 2 additions & 2 deletions mknodes/utils/classhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def to_dotted_path(
def list_classes(
module: types.ModuleType | str | tuple[str, ...],
*,
type_filter: type | None | types.UnionType = None,
type_filter: type | types.UnionType | None = None,
module_filter: str | None = None,
filter_by___all__: bool = False,
predicate: Callable[[type], bool] | None = None,
Expand Down Expand Up @@ -162,7 +162,7 @@ def list_classes(
def iter_classes(
module: types.ModuleType | str | tuple[str, ...],
*,
type_filter: type | None | types.UnionType = None,
type_filter: type | types.UnionType | None = None,
module_filter: str | None = None,
filter_by___all__: bool = False,
predicate: Callable[[type], bool] | None = None,
Expand Down

0 comments on commit 04c8315

Please sign in to comment.