From 4f78403463d8b1a1a83ae2f97910f4cfb4c3b0e8 Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Fri, 20 Sep 2013 10:11:45 -0500 Subject: [PATCH] BOM generators now report count of "interesting" components, rather than total components --- scripts/bom-in-python/bom_csv_by_ref.py | 6 +++--- scripts/bom-in-python/bom_csv_by_ref_v2.py | 6 +++--- scripts/bom-in-python/bom_html_by_value.py | 6 +++--- scripts/bom-in-python/bom_html_grouped_by_value.py | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/bom-in-python/bom_csv_by_ref.py b/scripts/bom-in-python/bom_csv_by_ref.py index b651afac2a..046272dec4 100644 --- a/scripts/bom-in-python/bom_csv_by_ref.py +++ b/scripts/bom-in-python/bom_csv_by_ref.py @@ -34,15 +34,15 @@ def writerow( acsvwriter, columns ): utf8row.append( str(col).encode('utf8') ) acsvwriter.writerow( utf8row ) +components = net.getInterestingComponents() + # Output a field delimited header line writerow( out, ['Source:', net.getSource()] ) writerow( out, ['Date:', net.getDate()] ) writerow( out, ['Tool:', net.getTool()] ) -writerow( out, ['Component Count:', len(net.components)] ) +writerow( out, ['Component Count:', len(components)] ) writerow( out, ['Ref', 'Value', 'Part', 'Documentation', 'Description', 'Vendor'] ) -components = net.getInterestingComponents() - # Output all of the component information for c in components: writerow( out, [c.getRef(), c.getValue(), c.getLibName() + ":" + c.getPartName(), diff --git a/scripts/bom-in-python/bom_csv_by_ref_v2.py b/scripts/bom-in-python/bom_csv_by_ref_v2.py index 30c8faaabb..ccb303e097 100644 --- a/scripts/bom-in-python/bom_csv_by_ref_v2.py +++ b/scripts/bom-in-python/bom_csv_by_ref_v2.py @@ -33,15 +33,15 @@ def writerow( acsvwriter, columns ): utf8row.append( str(col).encode('utf8') ) acsvwriter.writerow( utf8row ) +components = net.getInterestingComponents() + # Output a field delimited header line writerow( out, ['Source:', net.getSource()] ) writerow( out, ['Date:', net.getDate()] ) writerow( out, ['Tool:', net.getTool()] ) -writerow( out, ['Component Count:', len(net.components)] ) +writerow( out, ['Component Count:', len(components)] ) writerow( out, ['Ref', 'Value', 'Footprint', 'Datasheet', 'Manufacturer', 'Vendor'] ) -components = net.getInterestingComponents() - # Output all of the component information (One component per row) for c in components: writerow( out, [c.getRef(), c.getValue(), c.getFootprint(), c.getDatasheet(), diff --git a/scripts/bom-in-python/bom_html_by_value.py b/scripts/bom-in-python/bom_html_by_value.py index 244248ad71..b4493f5fe4 100644 --- a/scripts/bom-in-python/bom_html_by_value.py +++ b/scripts/bom-in-python/bom_html_by_value.py @@ -77,12 +77,14 @@ except IOError: print(__file__, ":", e, file=sys.stderr) f = stdout +components = net.getInterestingComponents() + # Output a set of rows for a header providing general information html = html.replace('', net.getSource()) html = html.replace('', net.getDate()) html = html.replace('', net.getTool()) html = html.replace('', "Component Count:" + \ - str(len(net.components))) + str(len(components))) row = "Ref" + "Qnty" row += "Value" + "Part" @@ -92,8 +94,6 @@ row += "PartNumber" + "Vendor" html = html.replace('', row + "") -components = net.getInterestingComponents() - # Get all of the components in groups of matching parts + values # (see kicad_netlist_reader.py) grouped = net.groupComponents(components) diff --git a/scripts/bom-in-python/bom_html_grouped_by_value.py b/scripts/bom-in-python/bom_html_grouped_by_value.py index 11bcc5dfb0..175191bcc4 100644 --- a/scripts/bom-in-python/bom_html_grouped_by_value.py +++ b/scripts/bom-in-python/bom_html_grouped_by_value.py @@ -42,12 +42,14 @@ except IOError: print(__file__, ":", e, file=sys.stderr) f = stdout +components = net.getInterestingComponents() + # Output a set of rows for a header providing general information html = html.replace('', net.getSource()) html = html.replace('', net.getDate()) html = html.replace('', net.getTool()) html = html.replace('', "Component Count:" + \ - str(len(net.components))) + str(len(components))) row = "Ref" + "Qnty" row += "Value" + "Part" + "Datasheet" @@ -55,8 +57,6 @@ row += "Description" + "Vendor" html = html.replace('', row + "") -components = net.getInterestingComponents() - # Get all of the components in groups of matching parts + values # (see kicad_netlist_reader.py) grouped = net.groupComponents(components)