devbisme / KiField

Edit/insert/delete part fields in KiCad schematics or libraries using a spreadsheet.
MIT License
70 stars 27 forks source link

[KiField Bug] AttributeError: 'Sheet_V6' object has no attribute 'filename #77

Open matejkolin opened 1 year ago

matejkolin commented 1 year ago

Describe the bug Trying to extract field data from a schematic into a .csv or .xlsx format, have the same results for both

To Reproduce

  1. Open windows power shell
  2. Go to the folder containing the shcematics: ".\BOJ01-kontroler-esp12e-01>"
  3. Type in: "kifield.exe -x .\BOJ01-kontroler-esp12e-01.kicad_sch -i '.\fileExtract.csv' -r"
  4. Get error: "AttributeError: 'Sheet_V6' object has no attribute 'filename'"

Expected behavior I'm expecting to get a file "fileExtract.csv" generated in my project folder "\BOJ01-kontroler-esp12e-01>"

Screenshots image PS C:\Users\Matej\Documents\test\BOJ01-kontroler-esp12e-01> kifield.exe -x .\BOJ01-kontroler-esp12e-01.kicad_sch -i '.\fileExtract.csv' -r Traceback (most recent call last): File "C:\Users\Matej\AppData\Local\Programs\Python\Python311\Scripts\kifield-script.py", line 33, in <module> sys.exit(load_entry_point('kifield==1.0.0', 'console_scripts', 'kifield')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Matej\AppData\Local\Programs\Python\Python311\Lib\site-packages\kifield\__main__.py", line 149, in main kifield( File "C:\Users\Matej\AppData\Local\Programs\Python\Python311\Lib\site-packages\kifield\kifield.py", line 1547, in kifield part_fields_dict = extract_part_fields( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Matej\AppData\Local\Programs\Python\Python311\Lib\site-packages\kifield\kifield.py", line 727, in extract_part_fields f_part_fields_dict = extraction_function( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Matej\AppData\Local\Programs\Python\Python311\Lib\site-packages\kifield\kifield.py", line 435, in extract_part_fields_from_sch_V6 sch = Schematic_V6(filename) # Read in the schematic. ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Matej\AppData\Local\Programs\Python\Python311\Lib\site-packages\kifield\sch.py", line 563, in __init__ self.children.append(self.__class__(sheet.filename, sheet.uuid_path)) ^^^^^^^^^^^^^^ AttributeError: 'Sheet_V6' object has no attribute 'filename'

Desktop (please complete the following information):

Additional context The schematic has hierarchical sheets