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

Shared interface between setting container types. More...

Inheritance diagram for UM.Settings.Interfaces.ContainerInterface:
UM.Settings.ContainerStack.ContainerStack UM.Settings.InstanceContainer.InstanceContainer

Public Member Functions

def __init__
 
def getId
 Get the ID of the container. More...
 
def getName
 Get the human-readable name of this container. More...
 
def getMetaData
 Get all metadata of this container. More...
 
def getMetaDataEntry
 Get the value of a single metadata entry. More...
 
def getProperty
 Get the value of a property of the container item. More...
 
def hasProperty
 Get whether the container item has a specific property. More...
 
def getAllKeys
 Get all the setting keys known to this container. More...
 
def serialize
 Serialize this container to a string. More...
 
def setProperty
 Change a property of a container item. More...
 
def deserialize
 Deserialize the container from a string representation. More...
 
def deserializeMetadata
 Deserialize just the metadata from a string representation. More...
 
def getLoadingPriority
 
def getConfigurationTypeFromSerialized
 Gets the configuration type of the given serialized data. More...
 
def getVersionFromSerialized
 Gets the version of the given serialized data. More...
 
def getPath
 Get the path used to create this InstanceContainer. More...
 
def setPath
 Set the path used to create this InstanceContainer.
 

Static Public Attributes

 propertyChanged = None
 
 metaDataChanged = None
 

Detailed Description

Shared interface between setting container types.

Member Function Documentation

def UM.Settings.Interfaces.ContainerInterface.deserialize (   self,
  serialized 
)

Deserialize the container from a string representation.

This should replace the contents of this container with those in the serialized representation.

Parameters
serializedA serialized string containing a container that should be deserialized.
def UM.Settings.Interfaces.ContainerInterface.deserializeMetadata (   cls,
  serialized 
)

Deserialize just the metadata from a string representation.

Parameters
serializedA string representing one or more containers that should be deserialized.
container_idThe ID of the (base) container is already known and provided here.
Returns
A list of the metadata of all containers found in the document.
def UM.Settings.Interfaces.ContainerInterface.getAllKeys (   self,
  Set,
  str 
)

Get all the setting keys known to this container.

Returns
Set of keys.
def UM.Settings.Interfaces.ContainerInterface.getConfigurationTypeFromSerialized (   cls,
  serialized 
)

Gets the configuration type of the given serialized data.

(used by __updateSerialized())

def UM.Settings.Interfaces.ContainerInterface.getId (   self,
  str 
)

Get the ID of the container.

The ID should be unique, machine readable and machine writable. It is intended to be used for example when referencing the container in configuration files or when writing a file to disk.

Returns
The unique ID of this container.
def UM.Settings.Interfaces.ContainerInterface.getMetaData (   self,
  Dict,
  str,
  Any 
)

Get all metadata of this container.

This returns a dictionary containing all the metadata for this container. How this metadata is used depends on the application.

Returns
The metadata for this container.
def UM.Settings.Interfaces.ContainerInterface.getMetaDataEntry (   self,
  entry 
)

Get the value of a single metadata entry.

Parameters
entryThe key of the metadata to retrieve.
defaultThe default value to return if the entry cannot be found.
Returns
The value of the metadata corresponding to name, or default when the entry could not be found.
def UM.Settings.Interfaces.ContainerInterface.getName (   self,
  str 
)

Get the human-readable name of this container.

This should return a human-readable name for the container, that can be used in the interface.

Returns
The name of this container.
def UM.Settings.Interfaces.ContainerInterface.getPath (   self,
  str 
)

Get the path used to create this InstanceContainer.

def UM.Settings.Interfaces.ContainerInterface.getProperty (   self,
  key 
)

Get the value of a property of the container item.

Parameters
keyThe key of the item to retrieve a property from.
property_nameThe name of the property to retrieve.
Returns
The specified property value of the container item corresponding to key, or None if not found.
def UM.Settings.Interfaces.ContainerInterface.getVersionFromSerialized (   cls,
  serialized 
)

Gets the version of the given serialized data.

(used by __updateSerialized())

def UM.Settings.Interfaces.ContainerInterface.hasProperty (   self,
  key 
)

Get whether the container item has a specific property.

Parameters
keyThe key of the item to check the property from.
nameThe name of the property to check for.
Returns
True if the specified item has the property, or False if it doesn't.
def UM.Settings.Interfaces.ContainerInterface.serialize (   self,
  ignored_metadata_keys 
)

Serialize this container to a string.

The serialized representation of the container can be used to write the container to disk or send it over the network.

Parameters
ignored_metadata_keysA set of keys that should be ignored when it serializes the metadata.
Returns
A string representation of this container.
def UM.Settings.Interfaces.ContainerInterface.setProperty (   self,
  key 
)

Change a property of a container item.

Parameters
keyThe key of the item to change the property of.
property_nameThe name of the property to change.
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.

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