diff --git a/scripts/bom-in-python/bom-generation.py b/scripts/bom-in-python/bom-generation.py index 8746575348..c0cda72fd8 100644 --- a/scripts/bom-in-python/bom-generation.py +++ b/scripts/bom-in-python/bom-generation.py @@ -4,8 +4,10 @@ # Example: Sorted and Grouped HTML BOM with more advanced grouping # +from __future__ import print_function + # Import the KiCad python helper module and the csv formatter -import ky_generic_netlist_reader +import kicad_netlist_reader import sys # Start with a basic html template @@ -43,9 +45,9 @@ def myEqu(self, other): result = True if self.getValue() != other.getValue(): result = False - elif self.getLib() != other.getLib(): + elif self.getLibName() != other.getLibName(): result = False - elif self.getPart() != other.getPart(): + elif self.getPartName() != other.getPartName(): result = False elif self.getFootprint() != other.getFootprint(): result = False @@ -61,18 +63,18 @@ def myEqu(self, other): # Override the component equivalence operator - it is important to do this # before loading the netlist, otherwise all components will have the original # equivalency operator. -ky_generic_netlist_reader.component.__equ__ = myEqu +kicad_netlist_reader.comp.__equ__ = myEqu # Generate an instance of a generic netlist, and load the netlist tree from # video.tmp. If the file doesn't exist, execution will stop -net = ky_generic_netlist_reader.netlist(sys.argv[1]) +net = kicad_netlist_reader.netlist(sys.argv[1]) # Open a file to write too, if the file cannot be opened output to stdout # instead try: f = open(sys.argv[2], 'w') except IOError: - print >> sys.stderr, __file__, ":", e + print(__file__, ":", e, file=sys.stderr) f = stdout # Output a set of rows for a header providing general information @@ -88,9 +90,11 @@ row += "
" + self.name + " " + self.chars + " |
|
" + self.name + " " + self.chars + " |
|