summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kconfiglib.py45
-rw-r--r--testsuite.py4
2 files changed, 30 insertions, 19 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 2741e10..dd99f14 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -2913,6 +2913,13 @@ class Symbol(object):
parent dependencies are automatically propagated to the conditions of
properties, so normally it's redundant to check the direct dependencies.
+ referenced:
+ A set() with all symbols and choices referenced in the properties and
+ property conditions of the symbol.
+
+ Also includes dependencies inherited from surrounding menus and if's.
+ Choices appear in the dependencies of choice symbols.
+
env_var:
If the Symbol has an 'option env="FOO"' option, this contains the name
("FOO") of the environment variable. None for symbols without no
@@ -3334,17 +3341,14 @@ class Symbol(object):
self.user_value = None
self._rec_invalidate_if_has_prompt()
+ @property
def referenced(self):
"""
- Returns a set() of all symbols and choices referenced in the properties
- and property conditions of the symbol.
-
- Also includes dependencies inherited from surrounding menus and if's.
- Choices appear in the dependencies of choice symbols.
+ See the class documentation.
"""
res = set()
for node in self.nodes:
- res |= node.referenced()
+ res |= node.referenced
return res
@@ -3776,6 +3780,12 @@ class Choice(object):
direct_dep:
See Symbol.direct_dep.
+ referenced:
+ A set() with all symbols referenced in the properties and property
+ conditions of the choice.
+
+ Also includes dependencies inherited from surrounding menus and if's.
+
is_optional:
True if the choice has the 'optional' flag set on it and can be in
n mode.
@@ -3925,17 +3935,14 @@ class Choice(object):
self.user_value = self.user_selection = None
self._rec_invalidate()
+ @property
def referenced(self):
"""
- Returns a set() of all symbols and choices referenced in the properties
- and property conditions of the choice.
-
- Also includes dependencies inherited from surrounding menus and if's.
- Choices appear in the dependencies of choice symbols.
+ See the class documentation.
"""
res = set()
for node in self.nodes:
- res |= node.referenced()
+ res |= node.referenced
return res
@@ -4175,6 +4182,13 @@ class MenuNode(object):
'visible if' dependencies are recursively propagated to the prompts of
symbols and choices within the menu.
+ referenced:
+ A set() with all symbols and choices referenced in the properties and
+ property conditions of the menu node.
+
+ Also includes dependencies inherited from surrounding menus and if's.
+ Choices appear in the dependencies of choice symbols.
+
is_menuconfig:
Set to True if the children of the menu node should be displayed in a
separate menu. This is the case for the following items:
@@ -4226,13 +4240,10 @@ class MenuNode(object):
self.implies = []
self.ranges = []
+ @property
def referenced(self):
"""
- Returns a set() of all symbols and choices referenced in the properties
- and property conditions of the menu node.
-
- Also includes dependencies inherited from surrounding menus and if's.
- Choices appear in the dependencies of choice symbols.
+ See the class documentation.
"""
# self.dep is included to catch dependencies from a lone 'depends on'
# when there are no properties to propagate it to
diff --git a/testsuite.py b/testsuite.py
index 8f93c81..64b5bd9 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -1009,12 +1009,12 @@ g
)
- print("Testing MenuNode/Symbol/Choice.referenced()")
+ print("Testing MenuNode/Symbol/Choice.referenced")
c = Kconfig("Kconfiglib/tests/Kreferenced", warn=False)
def verify_deps(item, *dep_names):
- verify_equal(tuple(sorted(item.name for item in item.referenced())),
+ verify_equal(tuple(sorted(item.name for item in item.referenced)),
dep_names)
verify_deps(c.top_node, "y")