From d26c9a39bd232de7f837095e3161e8f5ddf29e03 Mon Sep 17 00:00:00 2001 From: SET Date: Wed, 12 Aug 2020 09:46:46 -0300 Subject: [PATCH] Modified the "human readable" sheet path to be "/" for the root sheet. Not just empty. --- kiplot/kicad/v5_sch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kiplot/kicad/v5_sch.py b/kiplot/kicad/v5_sch.py index 16992486..fb655c86 100644 --- a/kiplot/kicad/v5_sch.py +++ b/kiplot/kicad/v5_sch.py @@ -909,7 +909,9 @@ class SchematicSheet(object): self.sheet = Schematic() parent_dir = os.path.dirname(parent) 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) return self.sheet @@ -997,7 +999,7 @@ class Schematic(object): raise SchFileError('Wrong entry in title block', line, _sch_line_number) 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. The caller must be sure the file exists. Only the schematics are loaded not the libs. """