Uranium
Application Framework
|
Public Member Functions | |
__init__ (self, *args, **kwargs) | |
str | getId (self) |
str | getName (self) |
Dict[str, Any] | getMetaData (self) |
Any | getMetaDataEntry (self, str entry, Any default=None) |
Any | getProperty (self, str key, str property_name, Optional[PropertyEvaluationContext] context=None) |
bool | hasProperty (self, str key, str property_name) |
Set[str] | getAllKeys (self) |
str | serialize (self, Optional[Set[str]] ignored_metadata_keys=None) |
None | setProperty (self, str key, str property_name, Any property_value, "ContainerInterface" container=None, bool set_from_cache=False) |
str | deserialize (self, str serialized, Optional[str] file_name=None) |
List[Dict[str, Any]] | deserializeMetadata (cls, str serialized, str container_id) |
int | getLoadingPriority (cls) |
Optional[str] | getConfigurationTypeFromSerialized (cls, str serialized) |
Optional[int] | getVersionFromSerialized (cls, str serialized) |
str | getPath (self) |
None | setPath (self, str path) |
bool | isDirty (self) |
None | setDirty (self, bool dirty) |
Static Public Attributes | |
propertyChanged = None | |
metaDataChanged = None | |
Protected Member Functions | |
bool | _trustHook (self, Optional[str] file_name) |
str | _updateSerialized (cls, str serialized, Optional[str] file_name=None) |
Shared interface between setting container types
|
protected |
Updates the given serialized data to the latest version.
str UM.Settings.Interfaces.ContainerInterface.deserialize | ( | self, | |
str | serialized, | ||
Optional[str] | file_name = None ) |
Deserialize the container from a string representation. This should replace the contents of this container with those in the serialized representation. :param serialized: A serialized string containing a container that should be deserialized.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
List[Dict[str, Any]] UM.Settings.Interfaces.ContainerInterface.deserializeMetadata | ( | cls, | |
str | serialized, | ||
str | container_id ) |
Deserialize just the metadata from a string representation. :param serialized: A string representing one or more containers that should be deserialized. :param container_id: The ID of the (base) container is already known and provided here. :return: A list of the metadata of all containers found in the document.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
Set[str] UM.Settings.Interfaces.ContainerInterface.getAllKeys | ( | self | ) |
Get all the setting keys known to this container. :return: Set of keys.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
Optional[str] UM.Settings.Interfaces.ContainerInterface.getConfigurationTypeFromSerialized | ( | cls, | |
str | serialized ) |
Gets the configuration type of the given serialized data. (used by __updateSerialized())
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
str UM.Settings.Interfaces.ContainerInterface.getId | ( | self | ) |
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. :return: The unique ID of this container.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
Dict[str, Any] UM.Settings.Interfaces.ContainerInterface.getMetaData | ( | self | ) |
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. :return: The metadata for this container.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
Any UM.Settings.Interfaces.ContainerInterface.getMetaDataEntry | ( | self, | |
str | entry, | ||
Any | default = None ) |
Get the value of a single metadata entry. :param entry: The key of the metadata to retrieve. :param default: The default value to return if the entry cannot be found. :return: The value of the metadata corresponding to `name`, or `default` when the entry could not be found.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
str UM.Settings.Interfaces.ContainerInterface.getName | ( | self | ) |
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. :return: The name of this container.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
str UM.Settings.Interfaces.ContainerInterface.getPath | ( | self | ) |
Get the path used to create this InstanceContainer.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
Any UM.Settings.Interfaces.ContainerInterface.getProperty | ( | self, | |
str | key, | ||
str | property_name, | ||
Optional[PropertyEvaluationContext] | context = None ) |
Get the value of a property of the container item. :param key: The key of the item to retrieve a property from. :param property_name: The name of the property to retrieve. :return: The specified property value of the container item corresponding to key, or None if not found.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
Optional[int] UM.Settings.Interfaces.ContainerInterface.getVersionFromSerialized | ( | cls, | |
str | serialized ) |
Gets the version of the given serialized data. (used by __updateSerialized())
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
bool UM.Settings.Interfaces.ContainerInterface.hasProperty | ( | self, | |
str | key, | ||
str | property_name ) |
Get whether the container item has a specific property. :param key: The key of the item to check the property from. :param name: The name of the property to check for. :return: True if the specified item has the property, or False if it doesn't.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
bool UM.Settings.Interfaces.ContainerInterface.isDirty | ( | self | ) |
Reimplemented in UM.Settings.InstanceContainer.InstanceContainer.
str UM.Settings.Interfaces.ContainerInterface.serialize | ( | self, | |
Optional[Set[str]] | ignored_metadata_keys = None ) |
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. :param ignored_metadata_keys: A set of keys that should be ignored when it serializes the metadata. :return: A string representation of this container.
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
None UM.Settings.Interfaces.ContainerInterface.setPath | ( | self, | |
str | path ) |
Set the path used to create this InstanceContainer
Reimplemented in UM.Settings.ContainerStack.ContainerStack, UM.Settings.DefinitionContainer.DefinitionContainer, and UM.Settings.InstanceContainer.InstanceContainer.
None UM.Settings.Interfaces.ContainerInterface.setProperty | ( | self, | |
str | key, | ||
str | property_name, | ||
Any | property_value, | ||
"ContainerInterface" | container = None, | ||
bool | set_from_cache = False ) |
Change a property of a container item. :param key: The key of the item to change the property of. :param property_name: The name of the property to change. :param property_value: The new value of the property. :param container: The container to use for retrieving values when changing the property triggers property updates. Defaults to None, which means use the current container. :param 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.
Reimplemented in UM.Settings.InstanceContainer.InstanceContainer.