SchrodingersGat / KiBoM

Configurable BoM generation tool for KiCad EDA (http://kicad.org/)
MIT License
352 stars 95 forks source link

Plugin fails Kicad 5.1.7 #142

Open sslupsky opened 3 years ago

sslupsky commented 3 years ago

I upgraded my KiCAD to version 5.1.7 today and I noticed that KiBOM_CLI crashes:

Run command:
python “/Users/stevenslupsky/kicad/KiBoM/KiBOM_CLI.py” “-dbom” “/Users/stevenslupsky/Library/Mobile Documents/com~apple~CloudDocs/Kicad/PB_16/Receiver_Out/Receiver_Out.xml” “/Users/stevenslupsky/Library/Mobile Documents/com~apple~CloudDocs/Kicad/PB_16/Receiver_Out/Receiver_Out.xls”

Command error. Return code 1
Info messages:
 KiBOM version 1.8.0
 Output directory: ‘/Users/stevenslupsky/Library/Mobile Documents/com~apple~CloudDocs/Kicad/PB_16/Receiver_Out/bom’
 Input: /Users/stevenslupsky/Library/Mobile Documents/com~apple~CloudDocs/Kicad/PB_16/Receiver_Out/Receiver_Out.xml
 Configuration file: /Users/stevenslupsky/Library/Mobile Documents/com~apple~CloudDocs/Kicad/PB_16/Receiver_Out/bom.ini
 PCB variant: [u’default’]

Error messages:
Traceback (most recent call last):
  File “/Users/stevenslupsky/kicad/KiBoM/KiBOM_CLI.py”, line 28, in <module>
    main()
  File “/Users/stevenslupsky/kicad/KiBoM/kibom/__main__.py”, line 194, in main
    result = writeVariant(input_file, output_dir, output_file, variant, pref)
  File “/Users/stevenslupsky/kicad/KiBoM/kibom/__main__.py”, line 55, in writeVariant
    groups = net.groupComponents(components)
  File “/Users/stevenslupsky/kicad/KiBoM/kibom/netlist_reader.py”, line 357, in groupComponents
    g.updateFields(self.prefs.useAlt)
  File “/Users/stevenslupsky/kicad/KiBoM/kibom/component.py”, line 614, in updateFields
    self.fields[ColumnList.COL_DESCRIPTION] = self.components[0].getDescription()
  File “/Users/stevenslupsky/kicad/KiBoM/kibom/component.py”, line 199, in getDescription
    raise AttributeError(‘Could not get description for part {}{}.’.format(self.getPrefix()),
IndexError: tuple index out of range

I tried it for csv, html or xls output and observed the same result.

I am not sure if the upgrade did this or something else is broken.

set-soft commented 3 years ago

First about the cryptic message, line 199(+200) should be:

                raise AttributeError('Could not get description for part {}{}.'.format(self.getPrefix(), self.getSuffix()))

Current code in the repo is wrong. The code has an extra ) after self.getPrefix()

Now about the problem: