From 1248e92b9556cbcaf82c3a36577bc98b0c9dc61f Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 11 Nov 2020 14:32:20 -0300 Subject: [PATCH] Fixed Internal BoM separator wasn't applied when using `use_alt` From the SchrodingersGat/KiBoM#145 PR. --- CHANGELOG.md | 3 ++- kibot/bom/bom.py | 2 +- tests/test_plot/test_int_bom.py | 2 +- tests/yaml_samples/int_bom_use_alt_2.kibot.yaml | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b595727..45798800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # [Unreleased] - +### Fixed +- Internal BoM separator wasn't applied when using `use_alt` ## [0.8.0] - 2020-11-06 ### Added diff --git a/kibot/bom/bom.py b/kibot/bom/bom.py index c02bc1f3..c9762817 100644 --- a/kibot/bom/bom.py +++ b/kibot/bom/bom.py @@ -198,7 +198,7 @@ class ComponentGroup(object): for n in self.components: P, N = (n.ref_prefix, _suffix_to_num(n.ref_suffix)) S.add(P, N) - return S.flush(' ') + return S.flush(self.cfg.ref_separator) def update_field(self, field, value, ref=None): """ Update a given field, concatenates existing values and informs a collision """ diff --git a/tests/test_plot/test_int_bom.py b/tests/test_plot/test_int_bom.py index 3993ce20..6dfac2fe 100644 --- a/tests/test_plot/test_int_bom.py +++ b/tests/test_plot/test_int_bom.py @@ -679,7 +679,7 @@ def test_int_bom_use_alt_2(): ref_column = header.index(REF_COLUMN_NAME) qty_column = header.index(QTY_COLUMN_NAME) # R3 without footprint won't be merged with other 10K resistors - check_kibom_test_netlist(rows, ref_column, KIBOM_TEST_GROUPS+1, KIBOM_TEST_EXCLUDE, KIBOM_TEST_COMPONENTS_ALT2) + check_kibom_test_netlist(rows, ref_column, KIBOM_TEST_GROUPS+1, KIBOM_TEST_EXCLUDE, KIBOM_TEST_COMPONENTS_ALT2, ref_sep=';') check_dnc(rows, 'R7', ref_column, qty_column) ctx.clean_up() diff --git a/tests/yaml_samples/int_bom_use_alt_2.kibot.yaml b/tests/yaml_samples/int_bom_use_alt_2.kibot.yaml index dcf874d5..cdbf915e 100644 --- a/tests/yaml_samples/int_bom_use_alt_2.kibot.yaml +++ b/tests/yaml_samples/int_bom_use_alt_2.kibot.yaml @@ -9,5 +9,6 @@ outputs: dir: BoM options: use_alt: true + ref_separator: ; merge_blank_fields: false