Skip to content

Commit

Permalink
re-apply black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfromearth committed Oct 23, 2023
1 parent 7a23620 commit 6718c9b
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions ncompare/printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
keep_print_history: bool = False,
no_color: bool = False,
text_file: Optional[Union[str, Path]] = None,
column_widths: Optional[tuple[int | str, int | str, int | str]] = None
column_widths: Optional[tuple[int | str, int | str, int | str]] = None,
):
"""Set up the handling of printing and saving destinations.
Expand All @@ -68,8 +68,10 @@ def __init__(
elif isinstance(width, int) and width > 0:
new_widths[idx] = width
else:
warnings.warn("Column-width input was not a positive integer. Reverting to default.")
self._column_widths = new_widths
warnings.warn(
"Column-width input was not a positive integer. Reverting to default."
)
self._column_widths = tuple(new_widths)
else:
self._column_widths = tuple(default_widths)

Expand Down Expand Up @@ -193,15 +195,21 @@ def side_by_side(self, str_a, str_b, str_c, dash_line=False, highlight_diff=Fals
str_marker = ""

if dash_line:
self.print(f" {extra_style_space}"
f"{str_a:>{self._column_widths[0]}} "
f"{str_b:->{self._column_widths[1]}} "
f"{str_c:->{self._column_widths[2]}}", colors=colors)
self.print(
f" {extra_style_space}"
f"{str_a:>{self._column_widths[0]}} "
f"{str_b:->{self._column_widths[1]}} "
f"{str_c:->{self._column_widths[2]}}",
colors=colors,
)
else:
self.print(f" {extra_style_space}"
f"{str_a:>{self._column_widths[0]}} "
f"{str_b:>{self._column_widths[1]}} "
f"{str_c:>{self._column_widths[2]}}", colors=colors)
self.print(
f" {extra_style_space}"
f"{str_a:>{self._column_widths[0]}} "
f"{str_b:>{self._column_widths[1]}} "
f"{str_c:>{self._column_widths[2]}}",
colors=colors,
)

self._add_to_history(str_a, str_b, str_c, str_marker)

Expand Down

0 comments on commit 6718c9b

Please sign in to comment.