menuconfig/genrest: Exclude implicit submenus from menu paths

Make all menu paths ("(top menu) -> menu -> submenu -> ...") exclude
implicit submenus, which are shown indented in the menuconfig interface
and are created when items depend on the symbol before them.

Previously, implicit submenus were excluded in the menu path at the top
of the menuconfig interface, but were included in the menuconfig symbol
information dialog and in the docs generated by genrest.py.

This makes it consistent, and un-spams the documentation for some
symbols a bit.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2018-05-21 18:38:44 +02:00 committed by Anas Nashif
parent 81b964b619
commit b45e152ff0
2 changed files with 19 additions and 10 deletions

View file

@ -177,12 +177,21 @@ def write_sym_rst(sym, out_dir):
def menu_path(node):
path = ""
menu = node.parent
while menu is not kconf.top_node:
# Fancy Unicode arrow. Added in '93, so ought to be pretty
# safe.
path = "" + menu.prompt[0] + path
menu = menu.parent
while True:
# This excludes indented submenus created in the menuconfig
# interface when items depend on the preceding symbol.
# is_menuconfig means anything that would be shown as a separate
# menu (not indented): proper 'menu's, menuconfig symbols, and
# choices.
node = node.parent
while not node.is_menuconfig:
node = node.parent
if node is kconf.top_node:
break
# Fancy Unicode arrow. Added in '93, so ought to be pretty safe.
path = "" + node.prompt[0] + path
return "(top menu)" + path

View file

@ -2006,10 +2006,10 @@ def _menu_path_info(node):
path = ""
menu = node.parent
while menu is not _kconf.top_node:
path = " -> " + menu.prompt[0] + path
menu = menu.parent
node = _parent_menu(node)
while node is not _kconf.top_node:
path = " -> " + node.prompt[0] + path
node = _parent_menu(node)
return "(top menu)" + path