Skip to content

Commit

Permalink
Apply black *.py ../../setup.py
Browse files Browse the repository at this point in the history
black==23.3.0
  • Loading branch information
kvid committed Jul 12, 2024
1 parent 828de3f commit 73f56b2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
4 changes: 0 additions & 4 deletions src/wireviz/DataClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class Image:
# See also HTML doc at https://graphviz.org/doc/info/shapes.html#html

def __post_init__(self):

if self.fixedsize is None:
# Default True if any dimension specified unless self.scale also is specified.
self.fixedsize = (self.width or self.height) and self.scale is None
Expand Down Expand Up @@ -166,7 +165,6 @@ class Connector:
additional_components: List[AdditionalComponent] = field(default_factory=list)

def __post_init__(self) -> None:

if isinstance(self.image, dict):
self.image = Image(**self.image)

Expand Down Expand Up @@ -276,7 +274,6 @@ class Cable:
additional_components: List[AdditionalComponent] = field(default_factory=list)

def __post_init__(self) -> None:

if isinstance(self.image, dict):
self.image = Image(**self.image)

Expand Down Expand Up @@ -386,7 +383,6 @@ def connect(
to_name: Optional[Designator],
to_pin: NoneOrMorePinIndices,
) -> None:

from_pin = int2tuple(from_pin)
via_wire = int2tuple(via_wire)
to_pin = int2tuple(to_pin)
Expand Down
4 changes: 2 additions & 2 deletions src/wireviz/Harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@
"autogenerate": "is replaced with new syntax in v0.4",
}


def check_old(node: str, old_attr: dict, args: dict) -> None:
"""Raise exception for any outdated attributes in args."""
for attr, descr in old_attr.items():
if attr in args:
raise ValueError(f"'{attr}' in {node}: '{attr}' {descr}")


@dataclass
class Harness:
metadata: Metadata
Expand Down Expand Up @@ -184,7 +186,6 @@ def create_graph(self) -> Graph:
dot.attr("edge", style="bold", fontname=self.options.fontname)

for connector in self.connectors.values():

# If no wires connected (except maybe loop wires)?
if not (connector.ports_left or connector.ports_right):
connector.ports_left = True # Use left side pins.
Expand Down Expand Up @@ -294,7 +295,6 @@ def create_graph(self) -> Graph:
)

for cable in self.cables.values():

html = []

awg_fmt = ""
Expand Down
1 change: 0 additions & 1 deletion src/wireviz/wireviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,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
7 changes: 3 additions & 4 deletions src/wireviz/wv_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def generate_html_output(
metadata: Metadata,
options: Options,
):

# load HTML template
templatename = metadata.get("template", {}).get("name")
if templatename:
Expand Down Expand Up @@ -112,9 +111,9 @@ def replacement_if_used(key: str, func: Callable[[], str]) -> None:
if isinstance(entry, Dict):
replacements[f"<!-- %{item}_{index+1}% -->"] = str(category)
for entry_key, entry_value in entry.items():
replacements[f"<!-- %{item}_{index+1}_{entry_key}% -->"] = (
html_line_breaks(str(entry_value))
)
replacements[
f"<!-- %{item}_{index+1}_{entry_key}% -->"
] = html_line_breaks(str(entry_value))
elif isinstance(entry, (str, int, float)):
pass # TODO?: replacements[f"<!-- %{item}_{category}% -->"] = html_line_breaks(str(entry))

Expand Down

0 comments on commit 73f56b2

Please sign in to comment.