[Diff] Now is "any" related

This commit is contained in:
Salvador E. Tropea 2024-02-01 12:22:25 -03:00
parent b88e09c448
commit 045b53463c
1 changed files with 9 additions and 1 deletions

View File

@ -556,7 +556,7 @@ class Diff(BaseOutput): # noqa: F821
def __init__(self):
super().__init__()
self._category = ['PCB/docs', 'Schematic/docs']
self._both_related = True
self._any_related = True
with document:
self.options = DiffOptions
""" *[dict] Options for the `diff` output """
@ -565,6 +565,14 @@ class Diff(BaseOutput): # noqa: F821
List of PCB layers to use. When empty all available layers are used.
Note that if you want to support adding/removing layers you should specify a list here """
def config(self, parent):
super().config(parent)
if self.get_user_defined('category'):
# The user specified a category, don't change it
return
# Adjust the category according to the selected output/s
self.category = ['PCB/docs' if self.options.pcb else 'Schematic/docs']
@staticmethod
def layer2dict(la):
return {'layer': la.layer, 'suffix': la.suffix, 'description': la.description}