Fix bugs from the the error handling additions.
This commit is contained in:
parent
0e929fe85a
commit
038938cc27
@ -116,9 +116,10 @@ class Connector:
|
|||||||
if len(loop) != 2:
|
if len(loop) != 2:
|
||||||
raise Exception('Loops must be between exactly two pins!')
|
raise Exception('Loops must be between exactly two pins!')
|
||||||
|
|
||||||
for additional_component in self.additional_components:
|
if self.additional_components:
|
||||||
if 'type' not in additional_component:
|
for additional_component in self.additional_components:
|
||||||
raise Exception('Additional components must have a type specified')
|
if 'type' not in additional_component:
|
||||||
|
raise Exception('Additional components must have a type specified')
|
||||||
|
|
||||||
def activate_pin(self, pin):
|
def activate_pin(self, pin):
|
||||||
self.visible_pins[pin] = True
|
self.visible_pins[pin] = True
|
||||||
@ -204,9 +205,10 @@ class Cable:
|
|||||||
else:
|
else:
|
||||||
raise Exception('lists of part data are only supported for bundles')
|
raise Exception('lists of part data are only supported for bundles')
|
||||||
|
|
||||||
for additional_component in self.additional_components:
|
if self.additional_components:
|
||||||
if 'type' not in additional_component:
|
for additional_component in self.additional_components:
|
||||||
raise Exception('Additional components must have a type specified')
|
if 'type' not in additional_component:
|
||||||
|
raise Exception('Additional components must have a type specified')
|
||||||
|
|
||||||
|
|
||||||
def connect(self, from_name, from_pin, via_pin, to_name, to_pin):
|
def connect(self, from_name, from_pin, via_pin, to_name, to_pin):
|
||||||
|
|||||||
@ -111,7 +111,7 @@ class Harness:
|
|||||||
qty *= sum(1 for value in connector.visible_pins.values() if value is True)
|
qty *= sum(1 for value in connector.visible_pins.values() if value is True)
|
||||||
else:
|
else:
|
||||||
raise ValueError('invalid qty parameter {}'.format(extra["qty_multiplier"]))
|
raise ValueError('invalid qty parameter {}'.format(extra["qty_multiplier"]))
|
||||||
rows.append(html_line_breaks(component_table_entry(extra.get["type"], qty, extra.get("unit", None), extra.get("pn", None), extra.get("manufacturer", None), extra.get("mpn", None))))
|
rows.append(html_line_breaks(component_table_entry(extra["type"], qty, extra.get("unit", None), extra.get("pn", None), extra.get("manufacturer", None), extra.get("mpn", None))))
|
||||||
rows.append([html_line_breaks(connector.notes)])
|
rows.append([html_line_breaks(connector.notes)])
|
||||||
html.extend(nested_html_table(rows))
|
html.extend(nested_html_table(rows))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user