From 82b299a159ea2fea05af894a04d328994dd7d31d Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 3 Oct 2022 13:07:03 -0300 Subject: [PATCH] [iBoM] Fixed the name displayed in the HTML when using filters - and/or variants --- CHANGELOG.md | 1 + kibot/out_base.py | 4 ++-- kibot/out_ibom.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc016c2d..d0b6d82e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Missing XYRS information for components with multiple units (#306) - Schematic v6: Problems when creating a variant of a sub-sheet that was edited as a standalone sheet (#307) +- iBoM: Name displayed in the HTML when using filters and/or variants. ### Changed - Diff: diff --git a/kibot/out_base.py b/kibot/out_base.py index e4eba3ff..b6a39f70 100644 --- a/kibot/out_base.py +++ b/kibot/out_base.py @@ -694,11 +694,11 @@ class VariantOptions(BaseOptions): return fname @staticmethod - def save_tmp_dir_board(id): + def save_tmp_dir_board(id, force_dir=None): """ Save the PCB to a temporal dir. Disadvantage: all relative paths inside the file becomes useless Aadvantage: the name of the file remains the same """ - pcb_dir = mkdtemp(prefix='tmp-kibot-'+id+'-') + pcb_dir = mkdtemp(prefix='tmp-kibot-'+id+'-') if force_dir is None else force_dir fname = os.path.join(pcb_dir, GS.pcb_basename+'.kicad_pcb') logger.debug('Storing modified PCB to `{}`'.format(fname)) GS.board.Save(fname) diff --git a/kibot/out_ibom.py b/kibot/out_ibom.py index 82dde23e..1f1775e6 100644 --- a/kibot/out_ibom.py +++ b/kibot/out_ibom.py @@ -180,7 +180,7 @@ class IBoMOptions(VariantOptions): GS.sch.save_netlist(f, self._comps) # Write a board with the filtered values applied self.sch_fields_to_pcb(self._comps, GS.board) - pcb_name = self.save_tmp_board(dir=net_dir) + pcb_name, _ = self.save_tmp_dir_board('ibom', force_dir=net_dir) else: # Check if the user wants extra_fields but there is no data about them (#68) if self.need_extra_fields() and not os.path.isfile(self.extra_data_file):