diff --git a/src/wireviz/DataClasses.py b/src/wireviz/DataClasses.py index c7dc007..a2f2a9e 100644 --- a/src/wireviz/DataClasses.py +++ b/src/wireviz/DataClasses.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- + from typing import Optional, List, Any from dataclasses import dataclass, field from wireviz.wv_helper import int2tuple @@ -72,7 +73,6 @@ class Cable: colors: List[Any] = field(default_factory=list) color_code: Optional[str] = None show_name: bool = True - show_pinout: bool = False show_wirecount: bool = True def __post_init__(self): diff --git a/src/wireviz/Harness.py b/src/wireviz/Harness.py index 595d13d..c11ad9a 100644 --- a/src/wireviz/Harness.py +++ b/src/wireviz/Harness.py @@ -109,10 +109,6 @@ class Harness: else: raise Exception('No side for loops') for loop in connector.loops: - - # FIXME: Original string.format style had some unused arguments (port_to for 1st arg, - # port_from for 2nd arg). De we need them back? - dot.edge(f'{connector.name}:p{loop[0]}{loop_side}:{loop_dir}', f'{connector.name}:p{loop[1]}{loop_side}:{loop_dir}') @@ -159,8 +155,6 @@ class Harness: for bla in p: html = html + f'{bla}' html = f'{html}' - - # FIXME, original string.format had a unused bgcolor argument. Do we need it back html = f'{html}' html = f'{html} ' # spacer at the end @@ -189,17 +183,12 @@ class Harness: from_ferrule = self.connectors[connection.from_name].category == 'ferrule' port = f':p{connection.from_port}r' if not from_ferrule else '' code_left_1 = f'{connection.from_name}{port}:e' - # FIXME: Uncomment, then add to end of f-string if needed - # via_subport = 'i' if c.show_pinout else '' code_left_2 = f'{cable.name}:w{connection.via_port}:w' dot.edge(code_left_1, code_left_2) from_string = f'{connection.from_name}:{connection.from_port}' if not from_ferrule else '' html = html.replace(f'', from_string) if connection.to_port is not None: # connect to right to_ferrule = self.connectors[connection.to_name].category == 'ferrule' - - # FIXME: Add in if it was supposed to be here. the add to fstring two lines down - # via_subport = 'o' if c.show_pinout else '' code_right_1 = f'{cable.name}:w{connection.via_port}:e' to_port = f':p{connection.to_port}l' if not to_ferrule else '' code_right_2 = f'{connection.to_name}{to_port}:w' @@ -214,11 +203,11 @@ class Harness: def output(self, filename, directory='_output', view=False, cleanup=True, fmt='pdf', gen_bom=False): # graphical output - digraph = self.create_graph() + graph = self.create_graph() for f in fmt: - digraph.format = f - digraph.render(filename=filename, directory=directory, view=view, cleanup=cleanup) - digraph.save(filename=f'{filename}.gv', directory=directory) + graph.format = f + graph.render(filename=filename, directory=directory, view=view, cleanup=cleanup) + graph.save(filename=f'{filename}.gv', directory=directory) # bom output bom_list = self.bom_list() with open(f'{filename}.bom.tsv', 'w') as file: diff --git a/src/wireviz/build_examples.py b/src/wireviz/build_examples.py index fc04fce..078e4e2 100755 --- a/src/wireviz/build_examples.py +++ b/src/wireviz/build_examples.py @@ -1,4 +1,5 @@ #!/usr/bin/python3 +# -*- coding: utf-8 -*- import os import sys diff --git a/src/wireviz/wireviz.py b/src/wireviz/wireviz.py index b94b459..81b4771 100755 --- a/src/wireviz/wireviz.py +++ b/src/wireviz/wireviz.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- - import argparse import os import sys @@ -199,15 +198,10 @@ def parse_cmdline(): parser = argparse.ArgumentParser( description='Generate cable and wiring harness documentation from YAML descriptions', ) - parser.add_argument('input_file', action='store', type=str, metavar='YAML_FILE') - parser.add_argument('-o', '--output_file', action='store', type=str, metavar='OUTPUT') - parser.add_argument('--generate-bom', action='store_true', default=True) - parser.add_argument('--prepend-file', action='store', type=str, metavar='YAML_FILE') - return parser.parse_args() diff --git a/src/wireviz/wv_colors.py b/src/wireviz/wv_colors.py index ad22659..055b467 100644 --- a/src/wireviz/wv_colors.py +++ b/src/wireviz/wv_colors.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- + COLOR_CODES = { 'DIN': ['WH', 'BN', 'GN', 'YE', 'GY', 'PK', 'BU', 'RD', 'BK', 'VT'], # ,'GYPK','RDBU','WHGN','BNGN','WHYE','YEBN','WHGY','GYBN','WHPK','PKBN'], 'IEC': ['BN', 'RD', 'OG', 'YE', 'GN', 'BU', 'VT', 'GY', 'WH', 'BK'], diff --git a/src/wireviz/wv_helper.py b/src/wireviz/wv_helper.py index b06d40e..65ccdb3 100644 --- a/src/wireviz/wv_helper.py +++ b/src/wireviz/wv_helper.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- + from typing import List