Skip to content

Commit

Permalink
Fix empty BOM output
Browse files Browse the repository at this point in the history
  • Loading branch information
formatc1702 committed Nov 1, 2020
1 parent d4b6e01 commit 109a7cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wireviz/wv_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def generate_bom(harness):
total_qty = sum(entry['qty'] for entry in group_entries)
bom.append({**group_entries[0], 'qty': round(total_qty, 3), 'designators': designators})

bom = sorted(harness._bom, key=lambda k: k['item']) # sort list of dicts by their values (https://stackoverflow.com/a/73050)
bom = sorted(bom, key=lambda k: k['item']) # sort list of dicts by their values (https://stackoverflow.com/a/73050)

# add an incrementing id to each bom item
bom = [{**entry, 'id': index} for index, entry in enumerate(bom, 1)]
Expand Down

0 comments on commit 109a7cc

Please sign in to comment.