Bool (hwx.inspire.Attributes)#
- class Bool(default=False, **kwds)#
Bases:
Attribute
Store True or False
# Name
Type
default
bool
state
NoneType
# Name
Description
castForSet
(self, obj, value)Converts and validates the bool value before setting.
create
(self, obj)Creates a bool attribute for the specified object.
getInCoreValue
(self, obj)Calls the incore get method (defined in C++) of the attribute.
setInCoreValue
(self, obj, value)Calls the incore set method (defined in C++) of the attribute.
Example
from hwx.inspire import * class Switch(GeneralObject): on = Bool(True) switch = Switch() print(switch.on)
- create(obj)#
Creates a bool attribute for the specified object.
- castForSet(obj, value)#
Converts and validates the bool value before setting.
- Parameters:
obj (GeneralObject) – Object this attribute belongs to.
value (str, bool) – Value of the attribute to set.
- Returns:
Validated and converted value.
- Return type:
bool
- setInCoreValue(obj, value)#
Calls the incore set method (defined in C++) of the attribute.
- getInCoreValue(obj)#
Calls the incore get method (defined in C++) of the attribute.