[Fixed] Missing sub-PCB name resolve for pre-flights

This commit is contained in:
Salvador E. Tropea 2022-12-22 13:00:20 -03:00
parent 421dcf34b7
commit b4fa74e774
2 changed files with 7 additions and 1 deletions

View File

@ -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 """

View File

@ -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)