Uranium
Application Framework
 All Classes Namespaces Files Functions Variables Pages
UM.Settings.SettingFunction.SettingFunction Class Reference

Encapsulates Python code that provides a simple value calculation function. More...

Inheritance diagram for UM.Settings.SettingFunction.SettingFunction:
UM.Settings.Validator.Validator

Public Member Functions

def __init__
 Constructor. More...
 
def __call__
 Call the actual function to calculate the value. More...
 
def __eq__
 
def isValid
 Returns whether the function is ready to be executed. More...
 
def getUsedSettingKeys
 Retrieve a set of the keys (strings) of all the settings used in this function. More...
 
def __str__
 
def __repr__
 
def __getstate__
 To support Pickle. More...
 
def __setstate__
 
def registerOperator
 Expose a custom function to the code executed by SettingFunction. More...
 

Detailed Description

Encapsulates Python code that provides a simple value calculation function.

Constructor & Destructor Documentation

def UM.Settings.SettingFunction.SettingFunction.__init__ (   self,
  expression 
)

Constructor.

Parameters
codeThe Python code this function should evaluate.

Member Function Documentation

def UM.Settings.SettingFunction.SettingFunction.__call__ (   self,
  value_provider 
)

Call the actual function to calculate the value.

Parameters
value_providerThe container from which to get setting values in the formula.
def UM.Settings.SettingFunction.SettingFunction.__getstate__ (   self,
  Dict,
  str,
  Any 
)

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.

def UM.Settings.SettingFunction.SettingFunction.getUsedSettingKeys (   self,
  FrozenSet,
  str 
)

Retrieve a set of the keys (strings) of all the settings used in this function.

Returns
A set of the keys (strings) of all the settings used in this functions.
def UM.Settings.SettingFunction.SettingFunction.isValid (   self,
  bool 
)

Returns whether the function is ready to be executed.

Returns
True if the function is valid, or False if it's not.
def UM.Settings.SettingFunction.SettingFunction.registerOperator (   cls,
  name 
)

Expose a custom function to the code executed by SettingFunction.

Parameters
nameWhat identifier to use in the executed code.
operatorA callable that implements the actual logic to execute.

The documentation for this class was generated from the following file: