diff options
| author | Philip Craig <philipjcraig@gmail.com> | 2015-03-12 21:23:38 +1000 |
|---|---|---|
| committer | Philip Craig <philipjcraig@gmail.com> | 2015-03-12 21:23:38 +1000 |
| commit | deaa62405116cc63dd7d03f4c5c58fa7ce7d91e6 (patch) | |
| tree | f21058b347a91f7cf82cdc169e5f3140570f1422 /kconfiglib.py | |
| parent | 11960409dc7b9dd50090c3c16b0ffd5f2a270031 (diff) | |
Add Symbol.is_allnoconfig_y()
Diffstat (limited to 'kconfiglib.py')
| -rw-r--r-- | kconfiglib.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 4d46f29..152c7af 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1325,9 +1325,12 @@ error, and you should e-mail kconfiglib@gmail.com. linenr) elif tokens.check(T_ALLNOCONFIG_Y): - self._warn("the 'allnoconfig_y' option is not supported.", - filename, - linenr) + if not isinstance(stmt, Symbol): + _parse_error(line, + "the 'allnoconfig_y' option is only valid for symbols.", + filename, + linenr) + stmt.allnoconfig_y = True else: _parse_error(line, "unrecognized option.", filename, linenr) @@ -2765,6 +2768,11 @@ class Symbol(Item, _HasVisibility): and sym.get_parent().get_selection() is sym'.""" return self.is_choice_symbol_ and self.parent.get_selection() is self + def is_allnoconfig_y(self): + """Returns True if the symbol has the 'allnoconfig_y' option set; + otherwise, returns False.""" + return self.allnoconfig_y + def __str__(self): """Returns a string containing various information about the symbol.""" return self.config._get_sym_or_choice_str(self) @@ -2862,6 +2870,9 @@ class Symbol(Item, _HasVisibility): # Does the symbol get its value from the environment? self.is_from_env = False + # Does the symbol have the 'allnoconfig_y' option set? + self.allnoconfig_y = False + def _invalidate(self): if self.is_special_: return |
