From b4fa74e774e49f0d8503d1fd0120920814fbc287 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Thu, 22 Dec 2022 13:00:20 -0300 Subject: [PATCH] [Fixed] Missing sub-PCB name resolve for pre-flights --- kibot/optionable.py | 2 +- kibot/pre_base.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kibot/optionable.py b/kibot/optionable.py index ded90099..bcebbcf7 100644 --- a/kibot/optionable.py +++ b/kibot/optionable.py @@ -280,7 +280,7 @@ class Optionable(object): self.variant = GS.solve_variant(self.variant) if self.variant._sub_pcb: return self.variant._sub_pcb.name - return Optionable._find_global_variant() + return Optionable._find_global_subpcb() def expand_filename_common(self, name, parent): """ Expansions common to the PCB and Schematic """ diff --git a/kibot/pre_base.py b/kibot/pre_base.py index 2f818f7b..1e44fff7 100644 --- a/kibot/pre_base.py +++ b/kibot/pre_base.py @@ -149,6 +149,12 @@ class BasePreFlight(Registrable): return self._variant.name return Optionable._find_global_variant_name() + def _find_subpcb(self): + # Preflights doesn't have a variant, but we could have one global default + if hasattr(self, '_variant') and self._variant and self.variant._sub_pcb: + return self.variant._sub_pcb.name + return Optionable._find_global_subpcb() + def ensure_tool(self, name): """ Looks for a mandatory dependency """ return GS.check_tool_dep(self._name, name, fatal=True)