Skip to content

Commit

Permalink
Apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
formatc1702 authored and kvid committed Aug 27, 2023
1 parent 40cd5dd commit 1664d48
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/wireviz/wireviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def alternate_type(): # flip between connector and cable/arrow
expected_type = alternating_types[1 - alternating_types.index(expected_type)]

for connection_set in connection_sets:

# figure out number of parallel connections within this set
connectioncount = []
for entry in connection_set:
Expand Down
6 changes: 1 addition & 5 deletions src/wireviz/wv_dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class Options:
_image_paths: List = field(default_factory=list)

def __post_init__(self):

self.bgcolor = SingleColor(self.bgcolor)
self.bgcolor_node = SingleColor(self.bgcolor_node)
self.bgcolor_connector = SingleColor(self.bgcolor_connector)
Expand Down Expand Up @@ -124,7 +123,6 @@ class Image:
# See also HTML doc at https://graphviz.org/doc/info/shapes.html#html

def __post_init__(self):

self.bgcolor = SingleColor(self.bgcolor)

if self.fixedsize is None:
Expand Down Expand Up @@ -258,7 +256,7 @@ def bom_amount(self) -> NumberAndUnit:
else:
return self.amount

@property
@property
def has_pn_info(self) -> bool:
return any([self.pn, self.manufacturer, self.mpn, self.supplier, self.spn])

Expand Down Expand Up @@ -368,7 +366,6 @@ def unit(self): # for compatibility with BOM hashing
return None # connectors do not support units.

def __post_init__(self) -> None:

super().fill_partnumbers()

self.bgcolor = SingleColor(self.bgcolor)
Expand Down Expand Up @@ -652,7 +649,6 @@ def _get_correct_element(inp, idx):
return None # non-bundles do not support lists of part data

def __post_init__(self) -> None:

super().fill_partnumbers()

self.bgcolor = SingleColor(self.bgcolor)
Expand Down
12 changes: 9 additions & 3 deletions src/wireviz/wv_graphviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,15 @@ def nested_table(lines: List[Td]) -> Table:
def nested_table_dict(d: dict) -> Table:
rows = []
for k, v in d.items():
rows.append(Tr([Td(k, align="left", balign="left", valign="top"), Td(html_line_breaks(v), align="left", balign="left")]))
return Table(rows, border=0, cellborder=1, cellpadding=3, cellspacing=0)
rows.append(
Tr(
[
Td(k, align="left", balign="left", valign="top"),
Td(html_line_breaks(v), align="left", balign="left"),
]
)
)
return Table(rows, border=0, cellborder=1, cellpadding=3, cellspacing=0)


def gv_pin_table(component) -> Table:
Expand Down Expand Up @@ -282,7 +289,6 @@ def gv_conductor_table(cable) -> Table:

inserted_break_inbetween = False
for wire in cable.wire_objects.values():

# insert blank space between wires and shields
if isinstance(wire, ShieldClass) and not inserted_break_inbetween:
rows.append(Tr(Td(" "))) # spacer row between wires and shields
Expand Down
8 changes: 6 additions & 2 deletions src/wireviz/wv_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
parse_arrow_str,
set_dot_basics,
)
from wireviz.wv_output import embed_svg_images, embed_svg_images_file, generate_html_output
from wireviz.wv_output import (
embed_svg_images,
embed_svg_images_file,
generate_html_output,
)
from wireviz.wv_utils import bom2tsv, open_file_write


Expand Down Expand Up @@ -217,7 +221,7 @@ def connect(
to_pin: Union[int, str],
) -> None:
# check from and to connectors
for (name, pin) in zip([from_name, to_name], [from_pin, to_pin]):
for name, pin in zip([from_name, to_name], [from_pin, to_pin]):
if name is not None and name in self.connectors:
connector = self.connectors[name]
# check if provided name is ambiguous
Expand Down
1 change: 0 additions & 1 deletion src/wireviz/wv_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def generate_html_output(
metadata: Metadata,
options: Options,
):

# load HTML template
templatename = metadata.get("template", {}).get("name")
if templatename:
Expand Down

0 comments on commit 1664d48

Please sign in to comment.