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)