Uranium
Application Framework
|
Encapsulates Python code that provides a simple value calculation function. More...
Public Member Functions | |
None | __init__ (self, str code) |
Constructor. More... | |
Any | __call__ (self, ContainerInterface value_provider, Optional[PropertyEvaluationContext] context=None) |
Call the actual function to calculate the value. More... | |
bool | __eq__ (self, other) |
bool | isValid (self) |
Returns whether the function is ready to be executed. More... | |
FrozenSet[str] | getUsedSettingKeys (self) |
Retrieve a set of the keys (strings) of all the settings used in this function. More... | |
str | __str__ (self) |
str | __repr__ (self) |
Dict[str, Any] | __getstate__ (self) |
To support Pickle. More... | |
None | __setstate__ (self, Dict[str, Any] state) |
None | registerOperator (cls, str name, Callable operator) |
Expose a custom function to the code executed by SettingFunction. More... | |
Encapsulates Python code that provides a simple value calculation function.
None UM.Settings.SettingFunction.SettingFunction.__init__ | ( | self, | |
str | code | ||
) |
Constructor.
code | The Python code this function should evaluate. |
Reimplemented in UM.Settings.Validator.Validator.
Any UM.Settings.SettingFunction.SettingFunction.__call__ | ( | self, | |
ContainerInterface | value_provider, | ||
Optional[PropertyEvaluationContext] | context = None |
||
) |
Call the actual function to calculate the value.
Reimplemented in UM.Settings.Validator.Validator.
Dict[str, Any] UM.Settings.SettingFunction.SettingFunction.__getstate__ | ( | self | ) |
To support Pickle.
Pickle does not support the compiled code, so instead remove it from the state. We can re-compile it later on anyway.
FrozenSet[str] UM.Settings.SettingFunction.SettingFunction.getUsedSettingKeys | ( | self | ) |
Retrieve a set of the keys (strings) of all the settings used in this function.
bool UM.Settings.SettingFunction.SettingFunction.isValid | ( | self | ) |
Returns whether the function is ready to be executed.
None UM.Settings.SettingFunction.SettingFunction.registerOperator | ( | cls, | |
str | name, | ||
Callable | operator | ||
) |
Expose a custom function to the code executed by SettingFunction.
name | What identifier to use in the executed code. |
operator | A callable that implements the actual logic to execute. |