diff options
author | rebortg <github@ghlr.de> | 2022-08-12 10:54:10 +0200 |
---|---|---|
committer | rebortg <github@ghlr.de> | 2022-08-12 10:59:13 +0200 |
commit | 1205c1e7806d4e84e03aafc94831248cbfa9b1c8 (patch) | |
tree | 05e620761cdfc775bab1729bfbfe289c0d7339a1 /docs/_ext/testcoverage.py | |
parent | a9346a61a4a879376032d1e71b81e365b1416afa (diff) | |
download | vyos-documentation-1205c1e7806d4e84e03aafc94831248cbfa9b1c8.tar.gz vyos-documentation-1205c1e7806d4e84e03aafc94831248cbfa9b1c8.zip |
add :defaultvalue: option
(cherry picked from commit b09f2222ed6181ba377a41de37a3997559a234c8)
Diffstat (limited to 'docs/_ext/testcoverage.py')
-rw-r--r-- | docs/_ext/testcoverage.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/docs/_ext/testcoverage.py b/docs/_ext/testcoverage.py index c06cf301..efe6e01d 100644 --- a/docs/_ext/testcoverage.py +++ b/docs/_ext/testcoverage.py @@ -175,12 +175,18 @@ def get_properties(p): def process_node(n, f): + props_elem = n.find("properties") children = n.find("children") command = n.find("command") children_nodes = [] owner = n.get("owner") node_type = n.tag + defaultvalue = n.find("defaultValue") + + if defaultvalue is not None: + defaultvalue = defaultvalue.text + name = n.get("name") props = get_properties(props_elem) @@ -218,7 +224,9 @@ def process_node(n, f): 'children': children_nodes, 'props': props, 'command': test_command, - 'filename': f + 'filename': f, + 'defaultvalue': defaultvalue + } return node @@ -232,9 +240,11 @@ def create_commands(data, parent_list=[], level=0): 'tag_help': [], 'level': level, 'no_childs': False, - 'filename': None + 'filename': None, + 'defaultvalue': None, } command['filename'] = data['filename'] + command['defaultvalue'] = data['defaultvalue'] command['name'].extend(parent_list) command['name'].append(data['name']) @@ -348,6 +358,7 @@ def get_working_commands(): 'children': [], 'command': node_data[kind][entry]['command'], 'filename': node_data[kind][entry]['filename'], + 'defaultvalue': node_data[kind][entry]['defaultvalue'] } config_tree_new[kind][node_0]['children'].extend(node_data[kind][entry]['children']) |