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

A container for SettingInstance objects. More...

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

Public Member Functions

def __init__
 Constructor. More...
 
def __hash__
 
def __deepcopy__
 
def __eq__
 
def __ne__
 
def getId
 
def setCachedValues
 
def getPath
 
def setPath
 
def getName
 
def setName
 
def isReadOnly
 
def setReadOnly
 
def getMetaData
 
def setMetaData
 
def getMetaDataEntry
 
def addMetaDataEntry
 Add a new entry to the metadata of this container. More...
 
def setMetaDataEntry
 Set a metadata entry to a certain value. More...
 
def isDirty
 Check if this container is dirty, that is, if it changed from deserialization. More...
 
def setDirty
 
def getProperty
 
def hasProperty
 
def setProperty
 Set the value of a property of a SettingInstance. More...
 
def clear
 Remove all instances from this container. More...
 
def getAllKeys
 Get all the keys of the instances of this container. More...
 
def duplicate
 Create a new InstanceContainer with the same contents as this container. More...
 
def serialize
 
def deserialize
 
def findInstances
 Find instances matching certain criteria. More...
 
def getInstance
 Get an instance by key.
 
def addInstance
 Add a new instance to this container. More...
 
def removeInstance
 Remove an instance from this container. More...
 
def getDefinition
 Get the DefinitionContainer used for new instance creation. More...
 
def setDefinition
 Set the DefinitionContainer to use for new instance creation. More...
 
def __lt__
 
def sendPostponedEmits
 Send postponed emits These emits are collected from the option postpone_emit. More...
 
- Public Member Functions inherited from UM.PluginObject.PluginObject
def __init__
 
def getPluginId
 
def setPluginId
 

Static Public Attributes

int Version = 2
 
tuple nameChanged = Signal()
 
tuple metaDataChanged = Signal()
 
tuple propertyChanged = Signal()
 

Properties

 id = property(getId)
 
 name = property(getName)
 
 metaData = property(getMetaData)
 

Detailed Description

A container for SettingInstance objects.

Constructor & Destructor Documentation

def UM.Settings.InstanceContainer.InstanceContainer.__init__ (   self,
  container_id,
  args,
  kwargs 
)

Constructor.

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

Member Function Documentation

def UM.Settings.InstanceContainer.InstanceContainer.addInstance (   self,
  instance 
)

Add a new instance to this container.

def UM.Settings.InstanceContainer.InstanceContainer.addMetaDataEntry (   self,
  key,
  value 
)

Add a new entry to the metadata of this container.

Parameters
keystr The key of the new entry.
valueThe value of the new entry.
Note
This does nothing if the key already exists.
def UM.Settings.InstanceContainer.InstanceContainer.clear (   self)

Remove all instances from this container.

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

Reimplemented from ContainerInterface

def UM.Settings.InstanceContainer.InstanceContainer.duplicate (   self,
  new_id 
)

Create a new InstanceContainer with the same contents as this container.

Parameters
new_idstr The new ID of the container
new_namestr The new name of the container. Defaults to None to indicate the name should not change.
Returns
A new InstanceContainer with the same contents as this container.
def UM.Settings.InstanceContainer.InstanceContainer.findInstances (   self,
  kwargs,
  List,
  SettingInstance 
)

Find instances matching certain criteria.

Parameters
kwargsdict A dictionary of keyword arguments with key-value pairs that should match properties of the instances.
def UM.Settings.InstanceContainer.InstanceContainer.getAllKeys (   self)

Get all the keys of the instances of this container.

Returns
list of keys
def UM.Settings.InstanceContainer.InstanceContainer.getDefinition (   self,
  DefinitionContainerInterface 
)

Get the DefinitionContainer used for new instance creation.

def UM.Settings.InstanceContainer.InstanceContainer.getId (   self,
  str 
)

Reimplemented from ContainerInterface

def UM.Settings.InstanceContainer.InstanceContainer.getMetaData (   self)

Reimplemented from ContainerInterface

def UM.Settings.InstanceContainer.InstanceContainer.getMetaDataEntry (   self,
  entry,
  default = None 
)

Reimplemented from ContainerInterface

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

Reimplemented from ContainerInterface

def UM.Settings.InstanceContainer.InstanceContainer.getPath (   self)

Reimplemented from ContainerInterface

def UM.Settings.InstanceContainer.InstanceContainer.getProperty (   self,
  key,
  property_name 
)

Reimplemented from ContainerInterface

def UM.Settings.InstanceContainer.InstanceContainer.hasProperty (   self,
  key,
  property_name 
)

Reimplemented from ContainerInterface.

def UM.Settings.InstanceContainer.InstanceContainer.isDirty (   self)

Check if this container is dirty, that is, if it changed from deserialization.

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

Reimplemented from ContainerInterface

def UM.Settings.InstanceContainer.InstanceContainer.removeInstance (   self,
  key 
)

Remove an instance from this container.

/param postpone_emit postpone emit until calling sendPostponedEmits

def UM.Settings.InstanceContainer.InstanceContainer.sendPostponedEmits (   self)

Send postponed emits These emits are collected from the option postpone_emit.

Note: the option can be implemented for all functions modifying the container.

def UM.Settings.InstanceContainer.InstanceContainer.serialize (   self,
  str 
)

Reimplemented from ContainerInterface

def UM.Settings.InstanceContainer.InstanceContainer.setDefinition (   self,
  definition 
)

Set the DefinitionContainer to use for new instance creation.

Since SettingInstance needs a SettingDefinition to work properly, we need some way of figuring out what SettingDefinition to use when creating a new SettingInstance.

def UM.Settings.InstanceContainer.InstanceContainer.setMetaDataEntry (   self,
  key,
  value 
)

Set a metadata entry to a certain value.

Parameters
keyThe key of the metadata entry to set.
valueThe new value of the metadata.
Note
This does nothing if the key is not already added to the metadata.
def UM.Settings.InstanceContainer.InstanceContainer.setPath (   self,
  path 
)

Reimplemented from ContainerInterface

def UM.Settings.InstanceContainer.InstanceContainer.setProperty (   self,
  key,
  property_name,
  property_value,
  container = None,
  set_from_cache = False 
)

Set the value of a property of a SettingInstance.

This will set the value of the specified property on the SettingInstance corresponding to key. If no instance has been created for the specified key, a new one will be created and inserted into this instance.

Parameters
keystring The key of the setting to set a property of.
property_namestring The name of the property to set.
property_valueThe new value of the property.
containerThe container to use for retrieving values when changing the property triggers property updates. Defaults to None, which means use the current container.
set_from_cacheFlag to indicate that the property was set from cache. This triggers the behavior that the read_only and setDirty are ignored.
Note
If no definition container is set for this container, new instances cannot be created and this method will do nothing.

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