Apply black

This commit is contained in:
Daniel Rojas 2023-03-27 17:56:15 +02:00 committed by KV
parent 5183fdaee4
commit 0b173700fa
5 changed files with 16 additions and 12 deletions

View File

@ -207,7 +207,6 @@ def parse(
expected_type = alternating_types[1 - alternating_types.index(expected_type)] expected_type = alternating_types[1 - alternating_types.index(expected_type)]
for connection_set in connection_sets: for connection_set in connection_sets:
# figure out number of parallel connections within this set # figure out number of parallel connections within this set
connectioncount = [] connectioncount = []
for entry in connection_set: for entry in connection_set:

View File

@ -86,7 +86,6 @@ class Options:
_image_paths: List = field(default_factory=list) _image_paths: List = field(default_factory=list)
def __post_init__(self): def __post_init__(self):
self.bgcolor = SingleColor(self.bgcolor) self.bgcolor = SingleColor(self.bgcolor)
self.bgcolor_node = SingleColor(self.bgcolor_node) self.bgcolor_node = SingleColor(self.bgcolor_node)
self.bgcolor_connector = SingleColor(self.bgcolor_connector) self.bgcolor_connector = SingleColor(self.bgcolor_connector)
@ -124,7 +123,6 @@ class Image:
# See also HTML doc at https://graphviz.org/doc/info/shapes.html#html # See also HTML doc at https://graphviz.org/doc/info/shapes.html#html
def __post_init__(self): def __post_init__(self):
self.bgcolor = SingleColor(self.bgcolor) self.bgcolor = SingleColor(self.bgcolor)
if self.fixedsize is None: if self.fixedsize is None:
@ -258,7 +256,7 @@ class Component:
else: else:
return self.amount return self.amount
@property @property
def has_pn_info(self) -> bool: def has_pn_info(self) -> bool:
return any([self.pn, self.manufacturer, self.mpn, self.supplier, self.spn]) return any([self.pn, self.manufacturer, self.mpn, self.supplier, self.spn])
@ -368,7 +366,6 @@ class Connector(TopLevelGraphicalComponent):
return None # connectors do not support units. return None # connectors do not support units.
def __post_init__(self) -> None: def __post_init__(self) -> None:
super().fill_partnumbers() super().fill_partnumbers()
self.bgcolor = SingleColor(self.bgcolor) self.bgcolor = SingleColor(self.bgcolor)
@ -654,7 +651,6 @@ class Cable(TopLevelGraphicalComponent):
return None # non-bundles do not support lists of part data return None # non-bundles do not support lists of part data
def __post_init__(self) -> None: def __post_init__(self) -> None:
super().fill_partnumbers() super().fill_partnumbers()
self.bgcolor = SingleColor(self.bgcolor) self.bgcolor = SingleColor(self.bgcolor)

View File

@ -230,8 +230,15 @@ def nested_table(lines: List[Td]) -> Table:
def nested_table_dict(d: dict) -> Table: def nested_table_dict(d: dict) -> Table:
rows = [] rows = []
for k, v in d.items(): 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")])) rows.append(
return Table(rows, border=0, cellborder=1, cellpadding=3, cellspacing=0) 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: def gv_pin_table(component) -> Table:
@ -282,7 +289,6 @@ def gv_conductor_table(cable) -> Table:
inserted_break_inbetween = False inserted_break_inbetween = False
for wire in cable.wire_objects.values(): for wire in cable.wire_objects.values():
# insert blank space between wires and shields # insert blank space between wires and shields
if isinstance(wire, ShieldClass) and not inserted_break_inbetween: if isinstance(wire, ShieldClass) and not inserted_break_inbetween:
rows.append(Tr(Td(" "))) # spacer row between wires and shields rows.append(Tr(Td(" "))) # spacer row between wires and shields

View File

@ -35,7 +35,11 @@ from wireviz.wv_graphviz import (
parse_arrow_str, parse_arrow_str,
set_dot_basics, 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 from wireviz.wv_utils import bom2tsv, open_file_write
@ -217,7 +221,7 @@ class Harness:
to_pin: Union[int, str], to_pin: Union[int, str],
) -> None: ) -> None:
# check from and to connectors # 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: if name is not None and name in self.connectors:
connector = self.connectors[name] connector = self.connectors[name]
# check if provided name is ambiguous # check if provided name is ambiguous

View File

@ -68,7 +68,6 @@ def generate_html_output(
metadata: Metadata, metadata: Metadata,
options: Options, options: Options,
): ):
# load HTML template # load HTML template
templatename = metadata.get("template", {}).get("name") templatename = metadata.get("template", {}).get("name")
if templatename: if templatename: