Skip to content

Commit

Permalink
style: Run ruff format on everything
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgate committed Apr 24, 2024
1 parent 13a27b2 commit 49a3972
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion shell_logger/html_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


def nested_simplenamespace_to_dict(
namespace: Union[str, bytes, tuple, Mapping, Iterable, SimpleNamespace]
namespace: Union[str, bytes, tuple, Mapping, Iterable, SimpleNamespace],
) -> Union[str, bytes, tuple, dict, list]:
"""
Convert a ``SimpleNamespace`` to a ``dict``.
Expand Down
2 changes: 0 additions & 2 deletions shell_logger/shell_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,8 @@ def to_html(self) -> Union[Iterator[str], List[Iterator[str]]]:
"""
html = []
for log in self.log_book:

# If this is a child ShellLogger...
if isinstance(log, ShellLogger):

# Update the duration of this ShellLogger's commands.
if log.duration is None:
log.__update_duration()
Expand Down
10 changes: 5 additions & 5 deletions test/test_shell_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,11 +799,11 @@ def test_sgr_gets_converted_to_html() -> None:
translated to valid HTML/CSS.
"""
logger = ShellLogger(stack()[0][3], Path.cwd())
logger.print("\x1B[31mHello\x1B[0m")
logger.print("\x1B[31;43m\x1B[4mthere\x1B[0m")
logger.print("\x1B[38;5;196m\x1B[48;5;232m\x1B[4mmr.\x1B[0m logger")
logger.print("\x1b[31mHello\x1b[0m")
logger.print("\x1b[31;43m\x1b[4mthere\x1b[0m")
logger.print("\x1b[38;5;196m\x1b[48;5;232m\x1b[4mmr.\x1b[0m logger")
logger.print(
"\x1B[38;2;96;140;240m\x1B[48;2;240;140;10mmrs.\x1B[0m logger"
"\x1b[38;2;96;140;240m\x1b[48;2;240;140;10mmrs.\x1b[0m logger"
)
logger.finalize()

Expand All @@ -812,7 +812,7 @@ def test_sgr_gets_converted_to_html() -> None:
assert html_file.exists()
with html_file.open("r") as hf:
html_text = hf.read()
assert "\x1B" not in html_text
assert "\x1b" not in html_text
assert ">Hello</span>" in html_text
assert ">there</span>" in html_text
assert ">mr.</span></span></span> logger" in html_text
Expand Down

0 comments on commit 49a3972

Please sign in to comment.