Modified the "human readable" sheet path to be "/" for the root sheet.

Not just empty.
This commit is contained in:
SET 2020-08-12 09:46:46 -03:00
parent 4502860f79
commit d26c9a39bd
1 changed files with 4 additions and 2 deletions

View File

@ -909,7 +909,9 @@ class SchematicSheet(object):
self.sheet = Schematic() self.sheet = Schematic()
parent_dir = os.path.dirname(parent) parent_dir = os.path.dirname(parent)
sheet_path += '/'+self.id sheet_path += '/'+self.id
sheet_path_h += '/'+(self.name if self.name else 'Unknown') if len(sheet_path_h) > 1:
sheet_path_h += '/'
sheet_path_h += self.name if self.name else 'Unknown'
self.sheet.load(os.path.join(parent_dir, self.file), sheet_path, sheet_path_h, libs, fields, fields_lc) self.sheet.load(os.path.join(parent_dir, self.file), sheet_path, sheet_path_h, libs, fields, fields_lc)
return self.sheet return self.sheet
@ -997,7 +999,7 @@ class Schematic(object):
raise SchFileError('Wrong entry in title block', line, _sch_line_number) raise SchFileError('Wrong entry in title block', line, _sch_line_number)
self.title_block[m.group(1)] = m.group(2) self.title_block[m.group(1)] = m.group(2)
def load(self, fname, sheet_path='', sheet_path_h='', libs={}, fields=[], fields_lc={}): def load(self, fname, sheet_path='', sheet_path_h='/', libs={}, fields=[], fields_lc={}):
""" Load a v5.x KiCad Schematic. """ Load a v5.x KiCad Schematic.
The caller must be sure the file exists. The caller must be sure the file exists.
Only the schematics are loaded not the libs. """ Only the schematics are loaded not the libs. """