diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2019-05-11 14:10:43 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2019-05-11 14:27:25 +0200 |
| commit | 95b80e16c4541089a8c5e33f73bbbac7a7f8ba8b (patch) | |
| tree | 869ff6d750b65c4ae3c464607906e7fb9fcf0e04 | |
| parent | ec30eb4da88803252524dfe9c64f12af0820887d (diff) | |
Clarify direct_dep and dep documentation
- Mention that having no direct dependencies corresponds to having y
direct dependencies
- Remove the note about how direct_dep is used internally. It's also
used for the select-with-unsatisfied-deps warning.
- Remove the note about how checking direct_dep might be "redundant"
since it's propagated. direct_dep can be useful in scripts still, and
maybe it could scare people away from it.
- Say 'surrounding menus and ifs' instead of of 'parent' in the 'dep'
docstring
- Fix two s/config/kconfig/ typos
| -rw-r--r-- | kconfiglib.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index e31b4c8..080d121 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3824,7 +3824,7 @@ class Symbol(object): ranges: List of (low, high, cond) tuples for the symbol's 'range' properties. For example, 'range 1 2 if A' is represented as (1, 2, A). If there is no - condition, 'cond' is self.config.y. + condition, 'cond' is self.kconfig.y. Note that 'depends on' and parent dependencies are propagated to 'range' conditions. @@ -3845,13 +3845,15 @@ class Symbol(object): Like rev_dep, for imply. direct_dep: - The 'depends on' dependencies. If a symbol is defined in multiple - locations, the dependencies at each location are ORed together. + The direct ('depends on') dependencies for the symbol, or self.kconfig.y + if there are no direct dependencies. - Internally, this is used to implement 'imply', which only applies if the - implied symbol has expr_value(self.direct_dep) != 0. 'depends on' and - parent dependencies are automatically propagated to the conditions of - properties, so normally it's redundant to check the direct dependencies. + This attribute includes any dependencies from surrounding menus and if's. + Those get propagated to the direct dependencies, and the resulting direct + dependencies in turn get propagated to the conditions of all properties. + + If the symbol is defined in multiple locations, the dependencies from the + different locations get ORed together. referenced: A set() with all symbols and choices referenced in the properties and @@ -4739,7 +4741,7 @@ class Choice(object): defaults: List of (symbol, cond) tuples for the choice's 'defaults' properties. For example, 'default A if B && C' is represented as (A, (AND, B, C)). If - there is no condition, 'cond' is self.config.y. + there is no condition, 'cond' is self.kconfig.y. Note that 'depends on' and parent dependencies are propagated to 'default' conditions. @@ -5144,10 +5146,12 @@ class MenuNode(object): was undocumented. dep: - The 'depends on' dependencies for the menu node, or self.kconfig.y if - there are no dependencies. Parent dependencies are propagated to this - attribute, and this attribute is then in turn propagated to the - properties of symbols and choices. + The direct ('depends on') dependencies for the menu node, or + self.kconfig.y if there are no direct dependencies. + + This attribute includes any dependencies from surrounding menus and if's. + Those get propagated to the direct dependencies, and the resulting direct + dependencies in turn get propagated to the conditions of all properties. If a symbol or choice is defined in multiple locations, only the properties defined at a particular location get the corresponding |
