Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Settings.Validator.Validator Class Reference

Validates that a SettingInstance's value is within a certain minimum and maximum value. More...

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

Public Member Functions

None __init__ (self, str key)
 Constructor.
 
Any __call__ (self, ContainerInterface value_provider, Optional[PropertyEvaluationContext] context=None)
 Perform the actual validation.
 
- Public Member Functions inherited from UM.Settings.SettingFunction.SettingFunction
None __init__ (self, str code)
 Constructor.
 
Any __call__ (self, ContainerInterface value_provider, Optional[PropertyEvaluationContext] context=None)
 Call the actual function to calculate the value.
 
bool __eq__ (self, other)
 
bool isValid (self)
 Returns whether the function is ready to be executed.
 
FrozenSet[str] getUsedSettingKeys (self)
 Retrieve a set of the keys (strings) of all the settings used in this function.
 
str __str__ (self)
 
str __repr__ (self)
 
Dict[str, Any] __getstate__ (self)
 To support Pickle.
 
None __setstate__ (self, Dict[str, Any] state)
 
None registerOperator (cls, str name, Callable operator)
 Expose a custom function to the code executed by SettingFunction.
 

Protected Attributes

 _key
 
- Protected Attributes inherited from UM.Settings.SettingFunction.SettingFunction
 _code
 
 _used_keys
 
 _used_values
 
 _compiled
 
 _valid
 

Detailed Description

Validates that a SettingInstance's value is within a certain minimum and maximum value.

This class performs validation of any value that has lt and gt implemented, but it is primarily used for numerical values like integers and floats.

Constructor & Destructor Documentation

◆ __init__()

None UM.Settings.Validator.Validator.__init__ (   self,
str  key 
)

Constructor.

Parameters
instanceThe instance this Validator validates.

Reimplemented from UM.Settings.SettingFunction.SettingFunction.

Member Function Documentation

◆ __call__()

Any UM.Settings.Validator.Validator.__call__ (   self,
ContainerInterface  value_provider,
Optional[PropertyEvaluationContext]   context = None 
)

Perform the actual validation.

Reimplemented from UM.Settings.SettingFunction.SettingFunction.


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