From 92c4d4f15d34b0cf2bdbd065a061fea671c2950e Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 27 Sep 2022 13:49:35 -0300 Subject: [PATCH] [DOCs][Fixed] Default values for KiBoM variant filters Closes #303 --- README.md | 8 ++++---- docs/Makefile | 4 ++-- kibot/var_kibom.py | 8 ++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index aa45ab3d..133d2b65 100644 --- a/README.md +++ b/README.md @@ -990,12 +990,12 @@ Note that the **_kibom_...** filters uses a field named `Config`, but you can cu * Valid keys: - `comment`: [string=''] A comment for documentation purposes. - `config_field`: [string='Config'] Name of the field used to classify components. - - `dnc_filter`: [string|list(string)=''] Name of the filter to mark components as 'Do Not Change'. + - `dnc_filter`: [string|list(string)='_kibom_dnc_CONFIG_FIELD'] Name of the filter to mark components as 'Do Not Change'. Use '_kibom_dnc' for the default KiBoM behavior. - - `dnf_filter`: [string|list(string)=''] Name of the filter to mark components as 'Do Not Fit'. + - `dnf_filter`: [string|list(string)='_kibom_dnf_CONFIG_FIELD'] Name of the filter to mark components as 'Do Not Fit'. Use '_kibom_dnf' for the default KiBoM behavior. - Use '_kicost_dnp'' for the default KiCost behavior. - - `exclude_filter`: [string|list(string)=''] Name of the filter to exclude components from BoM processing. + Use '_kicost_dnp'_kibom_dnf_CONFIG_FIELD' for the default KiCost behavior. + - `exclude_filter`: [string|list(string)='_mechanical'] Name of the filter to exclude components from BoM processing. Use '_mechanical' for the default KiBoM behavior. - `file_id`: [string=''] Text to use as the replacement for %v expansion. - `name`: [string=''] Used to identify this particular variant definition. diff --git a/docs/Makefile b/docs/Makefile index 7da1be0d..8b73e37d 100755 --- a/docs/Makefile +++ b/docs/Makefile @@ -10,10 +10,10 @@ all: ../README.md samples/generic_plot.kibot.yaml ../kibot/report_templates/rep ../kibot/config_templates/bom/%.kibot.yaml: samples/%.kibot.yaml cp $< $@ -../README.md: README.in replace_tags.pl ../kibot/out_*.py ../kibot/pre_*.py ../kibot/fil_*.py ../kibot/__main__.py ../kibot/config_reader.py ../kibot/globals.py ../kibot/dep_downloader.py +../README.md: README.in replace_tags.pl ../kibot/out_*.py ../kibot/pre_*.py ../kibot/var_*.py ../kibot/fil_*.py ../kibot/__main__.py ../kibot/config_reader.py ../kibot/globals.py ../kibot/dep_downloader.py cat README.in | perl replace_tags.pl > ../README.md -../src/kibot-check: ../src/kibot-check.in replace_tags.pl ../kibot/out_*.py ../kibot/pre_*.py ../kibot/registrable.py ../kibot/misc.py ../kibot/config_reader.py ../kibot/dep_downloader.py +../src/kibot-check: ../src/kibot-check.in replace_tags.pl ../kibot/out_*.py ../kibot/pre_*.py ../kibot/var_*.py ../kibot/registrable.py ../kibot/misc.py ../kibot/config_reader.py ../kibot/dep_downloader.py cat ../src/kibot-check.in | perl replace_tags.pl > ../src/kibot-check samples/generic_plot.kibot.yaml: ../kibot/out_*.py ../kibot/pre_*.py ../kibot/config_reader.py diff --git a/kibot/var_kibom.py b/kibot/var_kibom.py index 4e707d26..609824df 100644 --- a/kibot/var_kibom.py +++ b/kibot/var_kibom.py @@ -30,6 +30,14 @@ class KiBoM(BaseVariant): # noqa: F821 """ Name of the field used to classify components """ self.variant = Optionable """ [string|list(string)=''] Board variant(s) """ + self.fix_doc('exclude_filter', IFILT_MECHANICAL) + self.fix_doc('dnf_filter', '_kibom_dnf_CONFIG_FIELD') + self.fix_doc('dnc_filter', '_kibom_dnc_CONFIG_FIELD') + + def fix_doc(self, name, value): + d, _, _ = self.get_doc(name) + d = d.replace("''", "'"+value+"'") + self.set_doc(name, d) def get_variant_field(self): """ Returns the name of the field used to determine if the component belongs to the variant """