Uranium
Application Framework
|
A container for SettingInstance objects. More...
Public Member Functions | |
def | __init__ (self, container_id, args, kwargs) |
Constructor. More... | |
def | __hash__ (self) |
def | __deepcopy__ (self, memo) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | getId (self) |
def | setCachedValues (self, cached_values) |
def | getPath (self) |
def | setPath (self, path) |
def | getName (self) |
def | setName (self, name) |
def | isReadOnly (self) |
def | setReadOnly (self, read_only) |
def | getMetaData (self) |
def | setMetaData (self, metadata) |
def | getMetaDataEntry (self, entry, default=None) |
def | addMetaDataEntry (self, key, value) |
Add a new entry to the metadata of this container. More... | |
def | setMetaDataEntry (self, key, value) |
Set a metadata entry to a certain value. More... | |
def | isDirty (self) |
Check if this container is dirty, that is, if it changed from deserialization. More... | |
def | setDirty (self, dirty) |
def | getProperty (self, key, property_name) |
def | hasProperty (self, key, property_name) |
def | setProperty (self, key, property_name, property_value, container=None, set_from_cache=False) |
Set the value of a property of a SettingInstance. More... | |
def | clear (self) |
Remove all instances from this container. More... | |
def | getAllKeys (self) |
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 (self) |
def | deserialize |
def | findInstances (self, kwargs) |
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 (self) |
Get the DefinitionContainer used for new instance creation. More... | |
def | setDefinition |
Set the DefinitionContainer to use for new instance creation. More... | |
def | __lt__ (self, other) |
def | sendPostponedEmits (self) |
Send postponed emits These emits are collected from the option postpone_emit. More... | |
![]() | |
def | __init__ (self) |
def | getPluginId (self) |
def | setPluginId (self, plugin_id) |
Static Public Attributes | |
int | Version = 2 |
nameChanged = Signal() | |
metaDataChanged = Signal() | |
propertyChanged = Signal() | |
Properties | |
id = property(getId) | |
name = property(getName) | |
metaData = property(getMetaData) | |
A container for SettingInstance objects.
def UM.Settings.InstanceContainer.InstanceContainer.__init__ | ( | self, | |
container_id, | |||
args, | |||
kwargs | |||
) |
Constructor.
container_id | A unique, machine readable/writable ID for this container. |
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.
key | str The key of the new entry. |
value | The value of the new entry. |
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.
new_id | str The new ID of the container |
new_name | str The new name of the container. Defaults to None to indicate the name should not change. |
def UM.Settings.InstanceContainer.InstanceContainer.findInstances | ( | self, | |
kwargs, | |||
List, | |||
SettingInstance | |||
) |
Find instances matching certain criteria.
kwargs | dict 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.
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.
key | The key of the metadata entry to set. |
value | The new value of 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.
key | string The key of the setting to set a property of. |
property_name | string The name of the property to set. |
property_value | The new value of the property. |
container | The container to use for retrieving values when changing the property triggers property updates. Defaults to None, which means use the current container. |
set_from_cache | Flag to indicate that the property was set from cache. This triggers the behavior that the read_only and setDirty are ignored. |