From ea2664219d108e0426c22434bb3262cb1e53579c Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 19 Jul 2024 19:20:51 +0200 Subject: kicad: Make reprs more reasonable This excludes parent back-links from reprs, which would previously blow up the repr of many objects. --- gerbonara/cad/kicad/footprints.py | 4 ++-- gerbonara/cad/kicad/schematic.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'gerbonara') diff --git a/gerbonara/cad/kicad/footprints.py b/gerbonara/cad/kicad/footprints.py index c1655e7..43230ce 100644 --- a/gerbonara/cad/kicad/footprints.py +++ b/gerbonara/cad/kicad/footprints.py @@ -405,7 +405,7 @@ class Pad(NetMixin): options: OmitDefault(CustomPadOptions) = None primitives: OmitDefault(CustomPadPrimitives) = None _: SEXP_END = None - footprint: object = None + footprint: object = field(repr=False, default=None) def __after_parse__(self, parent=None): self.layers = unfuck_layers(self.layers) @@ -656,7 +656,7 @@ class Footprint: models: List(Model) = field(default_factory=list) _ : SEXP_END = None original_filename: str = None - board: object = None + board: object = field(repr=False, default=None) def __after_parse__(self, parent): for pad in self.pads: diff --git a/gerbonara/cad/kicad/schematic.py b/gerbonara/cad/kicad/schematic.py index bf32d11..9e7c6d4 100644 --- a/gerbonara/cad/kicad/schematic.py +++ b/gerbonara/cad/kicad/schematic.py @@ -357,7 +357,7 @@ class SymbolInstance: # three other uses of the same symbol in this schematic. instances: Named(Array(SymbolCrosslinkProject)) = field(default_factory=list) _ : SEXP_END = None - schematic: object = None + schematic: object = field(repr=False, default=None) def __after_parse__(self, parent): self.schematic = parent @@ -496,7 +496,7 @@ class Subsheet: _ : SEXP_END = None sheet_name: object = field(default_factory=lambda: DrawnProperty('Sheetname', '')) file_name: object = field(default_factory=lambda: DrawnProperty('Sheetfile', '')) - schematic: object = None + schematic: object = field(repr=False, default=None) def __after_parse__(self, parent): self.sheet_name, self.file_name = self._properties -- cgit