diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-03-24 07:08:10 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-03-24 07:10:30 +0100 |
commit | f85bb0bbaece4c3be58d3b023fd4d118e2c59030 (patch) | |
tree | 2f1937b76831f5c57f7a1ae19b1e71ac2c13a3fa | |
parent | 2fc6e8375a9a5b1b50f2ec7fa497721929f2a69a (diff) |
applconfig: Support "feature-enable" option type
-rw-r--r-- | rtemsqual/applconfig.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/rtemsqual/applconfig.py b/rtemsqual/applconfig.py index 81821db0..5cccb00a 100644 --- a/rtemsqual/applconfig.py +++ b/rtemsqual/applconfig.py @@ -48,8 +48,17 @@ def _gather_options(item: Item, options: ItemMap) -> None: options[item.uid] = item -_OPTION_TYPES = { - "feature": "This configuration option is a boolean feature define." +_FEATURE = "This configuration option is a boolean feature define." + +_OPTION_TYPES = {"feature": _FEATURE, "feature-enable": _FEATURE} + +_OPTION_DEFAULTS = { + "feature": + lambda item: item["appl-config-option-default"], + "feature-enable": + lambda item: + """If this configuration option is undefined, then the described feature is not +enabled.""" } @@ -69,10 +78,11 @@ def _generate_content(group: Item, options: ItemMap) -> SphinxContent: content.add_header(name, level="-") content.add_definition_item("CONSTANT:", f"``{name}``") if "appl-config-option-type" in item: - content.add_definition_item( - "OPTION TYPE:", _OPTION_TYPES[item["appl-config-option-type"]]) + option_type = item["appl-config-option-type"] + content.add_definition_item("OPTION TYPE:", + _OPTION_TYPES[option_type]) content.add_definition_item("DEFAULT CONFIGURATION:", - item["appl-config-option-default"]) + _OPTION_DEFAULTS[option_type](item)) else: content.add_definition_item("DATA TYPE:", item["appl-config-option-data-type"]) |