From 446e6736328c7db7f8e5cc7e35166b577d0a68a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pal=CC=8Co?= Date: Mon, 5 Oct 2026 21:56:12 +0200 Subject: [PATCH 1/2] Pass Eagle/Fusion board variant as metadata instead of in the title Since #574 the BOM header shows the variant from pcbdata.metadata.variant, and the %v/%V name format substitutions read the same key. The Eagle and Fusion parser never set it and instead appended ", Variant: X" to the title, so the variant header stayed hidden, the title got truncated and %V always produced "default". Put the current variant into metadata.variant like the KiCad parser does and keep the title as the file name. Co-Authored-By: Claude Opus 5.5 --- InteractiveHtmlBom/ecad/fusion_eagle.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/InteractiveHtmlBom/ecad/fusion_eagle.py b/InteractiveHtmlBom/ecad/fusion_eagle.py index 76d00196..9a7af09b 100644 --- a/InteractiveHtmlBom/ecad/fusion_eagle.py +++ b/InteractiveHtmlBom/ecad/fusion_eagle.py @@ -908,13 +908,12 @@ def _parse(self, brdfile): variant = [a.attrib['name'] for a in root.iter('variantdef') if a.get('current') == 'yes'] - variant = None if not variant else variant[0] - if variant: - title = "{0}, Variant: {1}".format(title, variant) + variant = '' if not variant else variant[0] date = datetime.fromtimestamp( os.path.getmtime(self.file_name)).strftime('%Y-%m-%d %H:%M:%S') self.pcbdata['metadata'] = {'title': title, 'revision': rev, - 'company': company, 'date': date} + 'company': company, 'date': date, + 'variant': variant} return self.pcbdata, self.components From 772b2ae774963b32297c401433f2674f5b8d371e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pal=CC=8Co?= Date: Tue, 6 Oct 2026 09:49:32 +0200 Subject: [PATCH 2/2] Only set Eagle/Fusion metadata variant when a variant is current Eagle and Fusion never store a variant with an empty name: variantdef names are required and the default assembly variant is implicit. Leave metadata.variant out when no variant is current instead of setting it to an empty string, so "no variant" stays distinguishable in the data. Co-Authored-By: Claude Opus 5.5 --- InteractiveHtmlBom/ecad/fusion_eagle.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/InteractiveHtmlBom/ecad/fusion_eagle.py b/InteractiveHtmlBom/ecad/fusion_eagle.py index 9a7af09b..e9676a47 100644 --- a/InteractiveHtmlBom/ecad/fusion_eagle.py +++ b/InteractiveHtmlBom/ecad/fusion_eagle.py @@ -906,14 +906,16 @@ def _parse(self, brdfile): title = os.path.basename(self.file_name) - variant = [a.attrib['name'] for a in root.iter('variantdef') if - a.get('current') == 'yes'] - variant = '' if not variant else variant[0] - date = datetime.fromtimestamp( os.path.getmtime(self.file_name)).strftime('%Y-%m-%d %H:%M:%S') self.pcbdata['metadata'] = {'title': title, 'revision': rev, - 'company': company, 'date': date, - 'variant': variant} + 'company': company, 'date': date} + + # Variants always have a name, the default assembly variant is + # implicit and not stored, so only set variant when one is current + variant = [a.attrib['name'] for a in root.iter('variantdef') if + a.get('current') == 'yes'] + if variant: + self.pcbdata['metadata']['variant'] = variant[0] return self.pcbdata, self.components