BOM Generation: Unifying reference concatenation using more pythonic string join to avoid trailing comma.

This commit is contained in:
Christian Weickhmann
2023-12-18 14:44:12 +00:00
committed by Jon Evans
parent fd91f8933e
commit 2ee75b1aec
3 changed files with 17 additions and 15 deletions
@@ -125,15 +125,16 @@ item = 0
for group in grouped:
del row[:]
refs = ""
refs_l = []
# Add the reference of every component in the group and keep a reference
# to the component so that the other data can be filled in once per group
for component in group:
if len(refs) > 0:
refs += ", "
refs += component.getRef()
refs_l.append( component.getRef() )
c = component
refs = ", ".join(refs_l)
# Fill in the component groups common data
# columns = ['Item', 'Qty', 'Reference(s)', 'Value', 'LibPart', 'Footprint', 'Datasheet', 'DNP'] + sorted(list(columnset))
item += 1
@@ -155,4 +156,4 @@ for group in grouped:
f.close()
if not canOpenFile:
sys.exit(1)
sys.exit(1)