MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / Symbol

Class Symbol

scripts/kconfig/kconfiglib.py:4086–5093  ·  view source on GitHub ↗

Represents a configuration symbol: (menu)config FOO ... The following attributes are available. They should be viewed as read-only, and some are implemented through @property magic (but are still efficient to access due to internal caching). Note: Prompts, hel

Source from the content-addressed store, hash-verified

4084
4085
4086class Symbol(object):
4087 """
4088 Represents a configuration symbol:
4089
4090 (menu)config FOO
4091 ...
4092
4093 The following attributes are available. They should be viewed as read-only,
4094 and some are implemented through @property magic (but are still efficient
4095 to access due to internal caching).
4096
4097 Note: Prompts, help texts, and locations are stored in the Symbol's
4098 MenuNode(s) rather than in the Symbol itself. Check the MenuNode class and
4099 the Symbol.nodes attribute. This organization matches the C tools.
4100
4101 name:
4102 The name of the symbol, e.g. "FOO" for 'config FOO'.
4103
4104 type:
4105 The type of the symbol. One of BOOL, TRISTATE, STRING, INT, HEX, UNKNOWN.
4106 UNKNOWN is for undefined symbols, (non-special) constant symbols, and
4107 symbols defined without a type.
4108
4109 When running without modules (MODULES having the value n), TRISTATE
4110 symbols magically change type to BOOL. This also happens for symbols
4111 within choices in "y" mode. This matches the C tools, and makes sense for
4112 menuconfig-like functionality.
4113
4114 orig_type:
4115 The type as given in the Kconfig file, without any magic applied. Used
4116 when printing the symbol.
4117
4118 tri_value:
4119 The tristate value of the symbol as an integer. One of 0, 1, 2,
4120 representing n, m, y. Always 0 (n) for non-bool/tristate symbols.
4121
4122 This is the symbol value that's used outside of relation expressions
4123 (A, !A, A && B, A || B).
4124
4125 str_value:
4126 The value of the symbol as a string. Gives the value for string/int/hex
4127 symbols. For bool/tristate symbols, gives "n", "m", or "y".
4128
4129 This is the symbol value that's used in relational expressions
4130 (A = B, A != B, etc.)
4131
4132 Gotcha: For int/hex symbols, the exact format of the value is often
4133 preserved (e.g. when writing a .config file), hence why you can't get it
4134 directly as an int. Do int(int_sym.str_value) or
4135 int(hex_sym.str_value, 16) to get the integer value.
4136
4137 user_value:
4138 The user value of the symbol. None if no user value has been assigned
4139 (via Kconfig.load_config() or Symbol.set_value()).
4140
4141 Holds 0, 1, or 2 for bool/tristate symbols, and a string for the other
4142 symbol types.
4143

Callers 3

_initMethod · 0.70
_lookup_symMethod · 0.70
_lookup_const_symMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected