Remove aditional component type capitilisation and swap to rstrip.

This commit is contained in:
Tyler Ward 2020-10-20 22:30:18 +01:00
parent 052348cd54
commit 4eeff65cf1
2 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@ from pathlib import Path
from wireviz.wv_helper import int2tuple, aspect_ratio from wireviz.wv_helper import int2tuple, aspect_ratio
from wireviz import wv_colors from wireviz import wv_colors
# Literal type aliases below are commented to avoid requiring python 3.8
ConnectorMultiplier = str # = Literal['pincount', 'populated'] ConnectorMultiplier = str # = Literal['pincount', 'populated']
CableMultiplier = str # = Literal['wirecount', 'terminations', 'length', 'total_length'] CableMultiplier = str # = Literal['wirecount', 'terminations', 'length', 'total_length']
@ -59,7 +60,7 @@ class AdditionalComponent:
@property @property
def description(self) -> str: def description(self) -> str:
return self.type.capitalize().strip() + (f', {self.subtype.strip()}' if self.subtype else '') return self.type.rstrip() + (f', {self.subtype.rstrip()}' if self.subtype else '')
@dataclass @dataclass

View File

@ -342,7 +342,7 @@ class Harness:
qty = extra.qty * component.get_qty_multiplier(extra.qty_multiplier) qty = extra.qty * component.get_qty_multiplier(extra.qty_multiplier)
if self.mini_bom_mode: if self.mini_bom_mode:
id = self.get_bom_index(extra.description, extra.unit, extra.manufacturer, extra.mpn, extra.pn) id = self.get_bom_index(extra.description, extra.unit, extra.manufacturer, extra.mpn, extra.pn)
rows.append(component_table_entry(f'#{id} ({extra.type.capitalize().strip()})', qty, extra.unit)) rows.append(component_table_entry(f'#{id} ({extra.type.rstrip()})', qty, extra.unit))
else: else:
rows.append(component_table_entry(extra.description, qty, extra.unit, extra.pn, extra.manufacturer, extra.mpn)) rows.append(component_table_entry(extra.description, qty, extra.unit, extra.pn, extra.manufacturer, extra.mpn))
return(rows) return(rows)