[DOCs][Fixed] Default values for KiBoM variant filters

Closes #303
This commit is contained in:
Salvador E. Tropea 2022-09-27 13:49:35 -03:00
parent ee967235e6
commit 92c4d4f15d
3 changed files with 14 additions and 6 deletions

View File

@ -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.

View File

@ -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

View File

@ -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 """