Uranium
Application Framework
UM.Settings.SettingDefinition.SettingDefinition Class Reference

Public Member Functions

def __init__
 
def __getattr__
 
def __setattr__
 
def __hash__ (self)
 
def __getstate__ (self)
 
def __setstate__ (self, state)
 
def key (self)
 
def container (self)
 
def parent (self)
 
def children (self)
 
def relations (self)
 
def serialize (self)
 
def getAllKeys (self)
 
def serialize_to_dict (self)
 
def deserialize
 
def getChild
 
def matchesFilter
 
def findDefinitions
 
def isAncestor
 
def isDescendant
 
def getAncestors (self)
 
def __repr__ (self)
 
def __eq__
 
def addSupportedProperty
 
def getPropertyNames
 
def hasProperty
 
def getPropertyType
 
def isRequiredProperty
 
def isReadOnlyProperty
 
def dependsOnProperty
 
def addSettingType
 
def settingValueFromString
 
def settingValueToString
 
def getValidatorForType
 

Detailed Description

Defines a single Setting with its properties.

This class defines a single Setting with all its properties. This class is considered immutable,
the only way to change it is using deserialize(). Should any state need to be stored for a definition,
create a SettingInstance pointing to the definition, then store the value in that instance.

== Supported Properties

The SettingDefinition class contains a concept of "supported properties". These are properties that
are supported when serializing or deserializing a setting. These properties are defined through the
addSupportedProperty() method. Each property needs a name and a type. In addition, there are two
optional boolean value to indicate whether the property is "required" and whether it is "read only".
Currently, four types of supported properties are defined. Please DefinitionPropertyType for a description
of these types.

Required properties are properties that should be present when deserializing a setting. If the property
is not present, an error will be raised. Read-only properties are properties that should never change
after creating a SettingDefinition. This means they cannot be stored in a SettingInstance object.

Member Function Documentation

◆ __getstate__()

def UM.Settings.SettingDefinition.SettingDefinition.__getstate__ (   self)
For Pickle support.

This should be identical to Pickle's default behaviour but the default
behaviour doesn't combine well with a non-default __getattr__.

◆ __hash__()

def UM.Settings.SettingDefinition.SettingDefinition.__hash__ (   self)
Ensure that the SettingDefinition is hashable, so it can be used in a set.

◆ __setstate__()

def UM.Settings.SettingDefinition.SettingDefinition.__setstate__ (   self,
  state 
)
For Pickle support.

This should be identical to Pickle's default behaviour but the default
behaviour doesn't combine well with a non-default __getattr__.

◆ children()

def UM.Settings.SettingDefinition.SettingDefinition.children (   self,
  List,
  SettingDefinition 
)
A list of children of this setting.

:return: :type{list<SettingDefinition>}

◆ container()

def UM.Settings.SettingDefinition.SettingDefinition.container (   self,
  Optional,
  DefinitionContainerInterface 
)
The container of this setting.

:return:

◆ getAllKeys()

def UM.Settings.SettingDefinition.SettingDefinition.getAllKeys (   self,
  Set,
  str 
)
Gets the key of this setting definition and of all its descendants.

:return: A set of the key in this definition and all its descendants.

◆ getAncestors()

def UM.Settings.SettingDefinition.SettingDefinition.getAncestors (   self,
  Set,
  str 
)
Get a set of keys representing the setting's ancestors.

◆ key()

def UM.Settings.SettingDefinition.SettingDefinition.key (   self,
  str 
)
The key of this setting.

:return: :type{string}

◆ parent()

def UM.Settings.SettingDefinition.SettingDefinition.parent (   self,
  Optional,
  SettingDefinition 
)
The parent of this setting.

:return: :type{SettingDefinition}

◆ relations()

def UM.Settings.SettingDefinition.SettingDefinition.relations (   self,
  List,
  SettingRelation 
)
A list of SettingRelation objects of this setting.

:return: :type{list<SettingRelation>}

◆ serialize()

def UM.Settings.SettingDefinition.SettingDefinition.serialize (   self,
  str 
)
Serialize this setting to a string.

:return: :type{string} A serialized representation of this setting.

◆ serialize_to_dict()

def UM.Settings.SettingDefinition.SettingDefinition.serialize_to_dict (   self,
  Dict,
  str,
  Any 
)
Serialize this setting to a dict.

:return: :type{dict} A representation of this setting definition.

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