Skip to content

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

@matejkolin

Description

@matejkolin

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):

  • OS: Microsoft Windows 10 Professional (x64) Build 19044.2965 (21H2)
  • Python version: 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)]
  • KiField version: 1.0.0
  • KiCad version: 7.0.5

Additional context
The schematic has hierarchical sheets

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions