Include part number info in BOM table

This commit is contained in:
Daniel Rojas 2022-08-05 13:38:51 +02:00 committed by Laurier Loiselle
parent c89c8dbda5
commit 682e45f01d
No known key found for this signature in database
GPG Key ID: 345920CC72089A3F

View File

@ -68,7 +68,7 @@ def pn_info_string(
def print_bom_debug(bom):
headers = "# qty unit description amount unit designators category".split(" ")
headers = "# qty unit description amount unit designators category pn manufacturer mpn supplier spn".split(" ")
rows = []
rows.append(headers)
# fill rows
@ -83,6 +83,16 @@ def print_bom_debug(bom):
", ".join(sorted(entry["designators"])),
f"{entry['category']} ({entry['category'].name})",
]
if hash.partnumbers:
cells.extend([
hash.partnumbers.pn,
hash.partnumbers.manufacturer,
hash.partnumbers.mpn,
hash.partnumbers.supplier,
hash.partnumbers.spn,
])
else:
cells.extend([None,None,None,None,None])
rows.append(cells)
# remove empty columns
transposed = list(map(list, zip(*rows)))