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

A container for SettingDefinition objects. More...

Inheritance diagram for UM.Settings.DefinitionContainer.DefinitionContainer:
UM.PluginObject.PluginObject

Public Member Functions

def __init__
 Constructor. More...
 
def __setattr__
 Reimplement setattr so we can make sure the definition remains unchanged after creation. More...
 
def __getnewargs__
 For pickle support.
 
def __getstate__
 For pickle support.
 
def __setstate__
 For pickle support.
 
def getId
 
def getName
 
def isReadOnly
 
def setReadOnly
 
def getPath
 
def setPath
 
def getMetaData
 
def definitions
 
def getInheritedFiles
 Gets all ancestors of this definition container. More...
 
def getAllKeys
 
def getMetaDataEntry
 
def getProperty
 
def hasProperty
 
def serialize
 
def getConfigurationTypeFromSerialized
 
def getVersionFromSerialized
 
def addDefinition
 Add a setting definition instance if it doesn't exist yet. More...
 
def deserialize
 
def deserializeMetadata
 Gets the metadata of a definition container from a serialised format. More...
 
def findDefinitions
 Find definitions matching certain criteria. More...
 
def getLoadingPriority
 
def __str__
 Simple short string representation for debugging purposes. More...
 
- Public Member Functions inherited from UM.PluginObject.PluginObject
def __init__
 
def getPluginId
 
def setPluginId
 
def setVersion
 
def getVersion
 

Static Public Attributes

int Version = 2
 
tuple id = pyqtProperty(str, fget = getId, constant = True)
 
tuple name = pyqtProperty(str, fget = getName, constant = True)
 
tuple readOnly = pyqtProperty(bool, fget = isReadOnly, constant = True)
 
tuple metaData = pyqtProperty("QVariantMap", fget = getMetaData, constant = True)
 
tuple propertyChanged = Signal()
 This signal is unused since the definition container is immutable, but is provided for API consistency. More...
 
tuple metaDataChanged = Signal()
 

Detailed Description

A container for SettingDefinition objects.

Constructor & Destructor Documentation

def UM.Settings.DefinitionContainer.DefinitionContainer.__init__ (   self,
  container_id 
)

Constructor.

Parameters
container_idA unique, machine readable/writable ID for this container.

Member Function Documentation

def UM.Settings.DefinitionContainer.DefinitionContainer.__setattr__ (   self,
  name 
)

Reimplement setattr so we can make sure the definition remains unchanged after creation.

def UM.Settings.DefinitionContainer.DefinitionContainer.__str__ (   self,
  str 
)

Simple short string representation for debugging purposes.

def UM.Settings.DefinitionContainer.DefinitionContainer.addDefinition (   self,
  definition 
)

Add a setting definition instance if it doesn't exist yet.

Warning: this might not work when there are relationships higher up in the stack.

def UM.Settings.DefinitionContainer.DefinitionContainer.deserialize (   self,
  serialized 
)

Reimplemented from ContainerInterface

def UM.Settings.DefinitionContainer.DefinitionContainer.deserializeMetadata (   cls,
  serialized 
)

Gets the metadata of a definition container from a serialised format.

This parses the entire JSON document and only extracts the metadata from it.

Parameters
serializedA JSON document, serialised as a string.
container_idThe ID of the container (as obtained from the file name).
Returns
A dictionary of metadata that was in the JSON document in a singleton list. If anything went wrong, the list will be empty.
def UM.Settings.DefinitionContainer.DefinitionContainer.findDefinitions (   self,
  kwargs 
)

Find definitions matching certain criteria.

Parameters
kwargsA dictionary of keyword arguments containing key-value pairs which should match properties of the definition.
def UM.Settings.DefinitionContainer.DefinitionContainer.getAllKeys (   self,
  Set,
  str 
)

Returns
A set of all keys of settings in this container.
def UM.Settings.DefinitionContainer.DefinitionContainer.getId (   self,
  str 
)

Reimplemented from ContainerInterface

def UM.Settings.DefinitionContainer.DefinitionContainer.getInheritedFiles (   self,
  List,
  str 
)

Gets all ancestors of this definition container.

This returns the definition in the "inherits" property of this container, and the definition in its "inherits" property, and so on. The ancestors are returned in order from parent to grand-grand-grand-...-grandparent, normally ending in a "root" container.

Returns
A list of ancestors, in order from near ancestor to the root.
def UM.Settings.DefinitionContainer.DefinitionContainer.getMetaData (   self,
  Dict,
  str,
  Any 
)

Reimplemented from ContainerInterface

def UM.Settings.DefinitionContainer.DefinitionContainer.getMetaDataEntry (   self,
  entry 
)

Reimplemented from ContainerInterface

def UM.Settings.DefinitionContainer.DefinitionContainer.getName (   self,
  str 
)

Reimplemented from ContainerInterface

def UM.Settings.DefinitionContainer.DefinitionContainer.getPath (   self,
  str 
)

Reimplemented from ContainerInterface

def UM.Settings.DefinitionContainer.DefinitionContainer.getProperty (   self,
  key 
)

Reimplemented from ContainerInterface.

def UM.Settings.DefinitionContainer.DefinitionContainer.hasProperty (   self,
  key 
)

Reimplemented from ContainerInterface

def UM.Settings.DefinitionContainer.DefinitionContainer.isReadOnly (   self,
  bool 
)

Reimplemented from ContainerInterface

def UM.Settings.DefinitionContainer.DefinitionContainer.serialize (   self,
  ignored_metadata_keys 
)

TODO: This implementation flattens the definition container, since the data about inheritance and overrides was lost when deserialising.

Reimplemented from ContainerInterface

def UM.Settings.DefinitionContainer.DefinitionContainer.setPath (   self,
  path 
)

Reimplemented from ContainerInterface

Member Data Documentation

tuple UM.Settings.DefinitionContainer.DefinitionContainer.propertyChanged = Signal()
static

This signal is unused since the definition container is immutable, but is provided for API consistency.


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