MCPcopy Create free account
hub / github.com/OpenCCU/OpenCCU / _finalize_node

Method _finalize_node

buildroot-external/scripts/kconfiglib.py:3595–3674  ·  view source on GitHub ↗
(self, node, visible_if)

Source from the content-addressed store, hash-verified

3593 #
3594
3595 def _finalize_node(self, node, visible_if):
3596 # Finalizes a menu node and its children:
3597 #
3598 # - Copies properties from menu nodes up to their contained
3599 # symbols/choices
3600 #
3601 # - Propagates dependencies from parent to child nodes
3602 #
3603 # - Creates implicit menus (see kconfig-language.txt)
3604 #
3605 # - Removes 'if' nodes
3606 #
3607 # - Sets 'choice' types and registers choice symbols
3608 #
3609 # menu_finalize() in the C implementation is similar.
3610 #
3611 # node:
3612 # The menu node to finalize. This node and its children will have
3613 # been finalized when the function returns, and any implicit menus
3614 # will have been created.
3615 #
3616 # visible_if:
3617 # Dependencies from 'visible if' on parent menus. These are added to
3618 # the prompts of symbols and choices.
3619
3620 if node.item.__class__ is Symbol:
3621 # Copy defaults, ranges, selects, and implies to the Symbol
3622 self._add_props_to_sym(node)
3623
3624 # Find any items that should go in an implicit menu rooted at the
3625 # symbol
3626 cur = node
3627 while cur.next and _auto_menu_dep(node, cur.next):
3628 # This makes implicit submenu creation work recursively, with
3629 # implicit menus inside implicit menus
3630 self._finalize_node(cur.next, visible_if)
3631 cur = cur.next
3632 cur.parent = node
3633
3634 if cur is not node:
3635 # Found symbols that should go in an implicit submenu. Tilt
3636 # them up above us.
3637 node.list = node.next
3638 node.next = cur.next
3639 cur.next = None
3640
3641 elif node.list:
3642 # The menu node is a choice, menu, or if. Finalize each child node.
3643
3644 if node.item is MENU:
3645 visible_if = self._make_and(visible_if, node.visibility)
3646
3647 # Propagate the menu node's dependencies to each child menu node.
3648 #
3649 # This needs to go before the recursive _finalize_node() call so
3650 # that implicit submenu creation can look ahead at dependencies.
3651 self._propagate_deps(node, visible_if)
3652

Callers 1

_initMethod · 0.95

Calls 8

_add_props_to_symMethod · 0.95
_make_andMethod · 0.95
_propagate_depsMethod · 0.95
_make_orMethod · 0.95
_auto_menu_depFunction · 0.85
_flattenFunction · 0.85
_remove_ifsFunction · 0.85
_finalize_choiceFunction · 0.85

Tested by

no test coverage detected