Fixed some typos I made
This commit is contained in:
parent
590ff8c2cb
commit
b3b4cf86d9
@ -10,7 +10,7 @@ from wireviz import wv_colors
|
|||||||
class Connector:
|
class Connector:
|
||||||
name: str
|
name: str
|
||||||
category: Optional[str] = None
|
category: Optional[str] = None
|
||||||
maintype: Optional[str] = None
|
type: Optional[str] = None
|
||||||
subtype: Optional[str] = None
|
subtype: Optional[str] = None
|
||||||
pincount: Optional[int] = None
|
pincount: Optional[int] = None
|
||||||
notes: Optional[str] = None
|
notes: Optional[str] = None
|
||||||
@ -61,7 +61,7 @@ class Connector:
|
|||||||
class Cable:
|
class Cable:
|
||||||
name: str
|
name: str
|
||||||
category: Optional[str] = None
|
category: Optional[str] = None
|
||||||
maintype: Optional[str] = None
|
type: Optional[str] = None
|
||||||
gauge: Optional[float] = None
|
gauge: Optional[float] = None
|
||||||
gauge_unit: Optional[str] = None
|
gauge_unit: Optional[str] = None
|
||||||
show_equiv: bool = False
|
show_equiv: bool = False
|
||||||
|
|||||||
@ -61,7 +61,7 @@ class Harness:
|
|||||||
if connector.category == 'ferrule':
|
if connector.category == 'ferrule':
|
||||||
subtype = f', {connector.subtype}' if connector.subtype else ''
|
subtype = f', {connector.subtype}' if connector.subtype else ''
|
||||||
color = wv_colors.translate_color(connector.color, self.color_mode) if connector.color else ''
|
color = wv_colors.translate_color(connector.color, self.color_mode) if connector.color else ''
|
||||||
infostring = f'{connector.maintype}{subtype} {color}'
|
infostring = f'{connector.type}{subtype} {color}'
|
||||||
infostring_l = infostring if connector.ports_right else ''
|
infostring_l = infostring if connector.ports_right else ''
|
||||||
infostring_r = infostring if connector.ports_left else ''
|
infostring_r = infostring if connector.ports_left else ''
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class Harness:
|
|||||||
>'''.format(infostring_l=infostring_l, infostring_r=infostring_r, colorbar=colorbar))
|
>'''.format(infostring_l=infostring_l, infostring_r=infostring_r, colorbar=colorbar))
|
||||||
|
|
||||||
else: # not a ferrule
|
else: # not a ferrule
|
||||||
attributes = [connector.maintype,
|
attributes = [connector.type,
|
||||||
connector.subtype,
|
connector.subtype,
|
||||||
f'{connector.pincount}-pin' if connector.show_pincount else'']
|
f'{connector.pincount}-pin' if connector.show_pincount else'']
|
||||||
pinouts = [[], [], []]
|
pinouts = [[], [], []]
|
||||||
@ -215,7 +215,7 @@ class Harness:
|
|||||||
def output(self, filename, directory='_output', view=False, cleanup=True, fmt='pdf', gen_bom=False):
|
def output(self, filename, directory='_output', view=False, cleanup=True, fmt='pdf', gen_bom=False):
|
||||||
# graphical output
|
# graphical output
|
||||||
digraph = self.create_graph()
|
digraph = self.create_graph()
|
||||||
for f in format:
|
for f in fmt:
|
||||||
digraph.format = f
|
digraph.format = f
|
||||||
digraph.render(filename=filename, directory=directory, view=view, cleanup=cleanup)
|
digraph.render(filename=filename, directory=directory, view=view, cleanup=cleanup)
|
||||||
digraph.save(filename=f'{filename}.gv', directory=directory)
|
digraph.save(filename=f'{filename}.gv', directory=directory)
|
||||||
@ -254,13 +254,13 @@ class Harness:
|
|||||||
bom_connectors = []
|
bom_connectors = []
|
||||||
bom_cables = []
|
bom_cables = []
|
||||||
# connectors
|
# connectors
|
||||||
types = Counter([(v.maintype, v.subtype, v.pincount) for v in self.connectors.values()])
|
types = Counter([(v.type, v.subtype, v.pincount) for v in self.connectors.values()])
|
||||||
for maintype in types:
|
for maintype in types:
|
||||||
items = {k: v for k, v in self.connectors.items() if (v.maintype, v.subtype, v.pincount) == maintype}
|
items = {k: v for k, v in self.connectors.items() if (v.type, v.subtype, v.pincount) == maintype}
|
||||||
shared = next(iter(items.values()))
|
shared = next(iter(items.values()))
|
||||||
designators = list(items.keys())
|
designators = list(items.keys())
|
||||||
designators.sort()
|
designators.sort()
|
||||||
conn_type = f', {shared.maintype}' if shared.maintype else ''
|
conn_type = f', {shared.type}' if shared.type else ''
|
||||||
conn_subtype = f', {shared.subtype}' if shared.subtype else ''
|
conn_subtype = f', {shared.subtype}' if shared.subtype else ''
|
||||||
conn_pincount = f', {shared.pincount} pins' if shared.category != 'ferrule' else ''
|
conn_pincount = f', {shared.pincount} pins' if shared.category != 'ferrule' else ''
|
||||||
conn_color = f', {shared.color}' if shared.color else ''
|
conn_color = f', {shared.color}' if shared.color else ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user