Uranium
Application Framework
|
Central class to manage all setting providers. More...
Public Member Functions | |
None | __init__ (self, "QtApplication" application) |
None | addResourceType (self, int resource_type, str container_type) |
Dict[str, int] | getResourceTypes (self) |
Returns all resource types. | |
"ContainerProvider" | getDefaultSaveProvider (self) |
None | addWrongContainerId (self, str wrong_container_id) |
This method adds the current id to the list of wrong containers that are skipped when looking for a container. | |
None | addProvider (self, ContainerProvider provider) |
Adds a container provider to search through containers in. | |
List[DefinitionContainerInterface] | findDefinitionContainers (self, **Any kwargs) |
Find all DefinitionContainer objects matching certain criteria. More... | |
List[Dict[str, Any]] | findDefinitionContainersMetadata (self, **Any kwargs) |
Get the metadata of all definition containers matching certain criteria. More... | |
List[InstanceContainer] | findInstanceContainers (self, **Any kwargs) |
Find all InstanceContainer objects matching certain criteria. More... | |
List[Dict[str, Any]] | findInstanceContainersMetadata (self, **Any kwargs) |
Find the metadata of all instance containers matching certain criteria. More... | |
List[ContainerStack] | findContainerStacks (self, **Any kwargs) |
Find all ContainerStack objects matching certain criteria. More... | |
List[Dict[str, Any]] | findContainerStacksMetadata (self, **Any kwargs) |
Find the metadata of all container stacks matching certain criteria. More... | |
List[ContainerInterface] | findContainers (self, *bool ignore_case=False, **Any kwargs) |
Find all container objects matching certain criteria. More... | |
List[Dict[str, Any]] | findContainersMetadata (self, *bool ignore_case=False, **Any kwargs) |
Find the metadata of all container objects matching certain criteria. More... | |
List[ContainerInterface] | findDirtyContainers (self, *bool ignore_case=False, **Any kwargs) |
Specialized find function to find only the modified container objects that also match certain criteria. More... | |
InstanceContainer | getEmptyInstanceContainer (self) |
This is a small convenience to make it easier to support complex structures in ContainerStacks. | |
bool | isReadOnly (self, str container_id) |
Returns whether a profile is read-only or not. More... | |
Optional[str] | getContainerFilePathById (self, str container_id) |
bool | isLoaded (self, str container_id) |
Returns whether a container is completely loaded or not. More... | |
None | loadAllMetadata (self) |
Load the metadata of all available definition containers, instance containers and container stacks. | |
None | load (self) |
Load all available definition containers, instance containers and container stacks. More... | |
None | addContainer (self, ContainerInterface container) |
None | removeContainer (self, str container_id) |
None | renameContainer (self, str container_id, str new_name, Optional[str] new_id=None) |
str | uniqueName (self, str original) |
Creates a new unique name for a container that doesn't exist yet. More... | |
None | addContainerType (cls, "PluginObject" container) |
Add a container type that will be used to serialize/deserialize containers. More... | |
None | addContainerTypeByName (cls, type container_type, str type_name, str mime_type) |
Used to associate mime types with object to be created. More... | |
Optional[MimeType] | getMimeTypeForContainer (cls, type container_type) |
Retrieve the mime type corresponding to a certain container type. More... | |
def | getContainerForMimeType (cls, mime_type) |
Get the container type corresponding to a certain mime type. More... | |
def | getContainerTypes (cls) |
Get all the registered container types. More... | |
None | saveContainer (self, "ContainerInterface" container, Optional["ContainerProvider"] provider=None) |
Save single dirty container. | |
None | saveDirtyContainers (self) |
Save all the dirty containers by calling the appropriate container providers. | |
str | getLockFilename (self) |
Get the lock filename including full path Dependent on when you call this function, Resources.getConfigStoragePath may return different paths. | |
str | getCacheLockFilename (self) |
Get the cache lock filename including full path. | |
LockFile | lockFile (self) |
Contextmanager to create a lock file and remove it afterwards. | |
LockFile | lockCache (self) |
Context manager to create a lock file for the cache directory and remove it afterwards. | |
"ContainerRegistry" | getInstance (cls, *args, **kwargs) |
![]() | |
"Application" | getApplication (cls) |
Public Attributes | |
metadata | |
source_provider | |
Static Public Attributes | |
containerAdded = Signal() | |
containerRemoved = Signal() | |
containerMetaDataChanged = Signal() | |
containerLoadComplete = Signal() | |
allMetadataLoaded = Signal() | |
dictionary | mime_type_map |
Central class to manage all setting providers.
This class aggregates all data from all container providers. If only the metadata is used, it requests the metadata lazily from the providers. If more than that is needed, the entire container is requested from the appropriate providers.
None UM.Settings.ContainerRegistry.ContainerRegistry.addContainerType | ( | cls, | |
"PluginObject" | container | ||
) |
Add a container type that will be used to serialize/deserialize containers.
container | An instance of the container type to add. |
None UM.Settings.ContainerRegistry.ContainerRegistry.addContainerTypeByName | ( | cls, | |
type | container_type, | ||
str | type_name, | ||
str | mime_type | ||
) |
Used to associate mime types with object to be created.
container_type | ContainerStack or derivative |
type_name | |
mime_type |
List[ContainerInterface] UM.Settings.ContainerRegistry.ContainerRegistry.findContainers | ( | self, | |
*bool | ignore_case = False , |
||
**Any | kwargs | ||
) |
Find all container objects matching certain criteria.
container_type | If provided, return only objects that are instances or subclasses of container_type. |
kwargs | dict A dictionary of keyword arguments containing keys and values that need to match the metadata of the container. An asterisk can be used to denote a wildcard. |
Reimplemented from UM.Settings.Interfaces.ContainerRegistryInterface.
List[Dict[str, Any]] UM.Settings.ContainerRegistry.ContainerRegistry.findContainersMetadata | ( | self, | |
*bool | ignore_case = False , |
||
**Any | kwargs | ||
) |
Find the metadata of all container objects matching certain criteria.
container_type | If provided, return only objects that are instances or subclasses of container_type . |
kwargs | A dictionary of keyword arguments containing keys and values that need to match the metadata. An asterisk can be used to denote a wildcard. |
List[ContainerStack] UM.Settings.ContainerRegistry.ContainerRegistry.findContainerStacks | ( | self, | |
**Any | kwargs | ||
) |
Find all ContainerStack objects matching certain criteria.
kwargs | dict A dictionary of keyword arguments containing keys and values that need to match the metadata of the ContainerStack. An asterisk in the values can be used to denote a wildcard. |
List[Dict[str, Any]] UM.Settings.ContainerRegistry.ContainerRegistry.findContainerStacksMetadata | ( | self, | |
**Any | kwargs | ||
) |
Find the metadata of all container stacks matching certain criteria.
kwargs | A dictionary of keyword arguments containing keys and values that need to match the metadata. An asterisk in the values can be used to denote a wildcard. |
List[DefinitionContainerInterface] UM.Settings.ContainerRegistry.ContainerRegistry.findDefinitionContainers | ( | self, | |
**Any | kwargs | ||
) |
Find all DefinitionContainer objects matching certain criteria.
kwargs | dict A dictionary of keyword arguments containing keys and values that need to match the metadata of the DefinitionContainer. An asterisk in the values can be used to denote a wildcard. |
Reimplemented from UM.Settings.Interfaces.ContainerRegistryInterface.
List[Dict[str, Any]] UM.Settings.ContainerRegistry.ContainerRegistry.findDefinitionContainersMetadata | ( | self, | |
**Any | kwargs | ||
) |
Get the metadata of all definition containers matching certain criteria.
kwargs | A dictionary of keyword arguments containing keys and values that need to match the metadata. An asterisk in the values can be used to denote a wildcard. |
List[ContainerInterface] UM.Settings.ContainerRegistry.ContainerRegistry.findDirtyContainers | ( | self, | |
*bool | ignore_case = False , |
||
**Any | kwargs | ||
) |
Specialized find function to find only the modified container objects that also match certain criteria.
This is faster than the normal find methods since it won't ever load all containers, but only the modified ones. Since containers must be fully loaded before they are modified, you are guaranteed that any operations on the resulting containers will not trigger additional containers to load lazily.
kwargs | dict A dictionary of keyword arguments containing keys and values that need to match the metadata of the container. An asterisk can be used to denote a wildcard. |
ignore_case | Whether casing should be ignored when matching string values of metadata. |
List[InstanceContainer] UM.Settings.ContainerRegistry.ContainerRegistry.findInstanceContainers | ( | self, | |
**Any | kwargs | ||
) |
Find all InstanceContainer objects matching certain criteria.
kwargs | dict A dictionary of keyword arguments containing keys and values that need to match the metadata of the InstanceContainer. An asterisk in the values can be used to denote a wildcard. |
List[Dict[str, Any]] UM.Settings.ContainerRegistry.ContainerRegistry.findInstanceContainersMetadata | ( | self, | |
**Any | kwargs | ||
) |
Find the metadata of all instance containers matching certain criteria.
kwargs | A dictionary of keyword arguments containing keys and values that need to match the metadata. An asterisk in the values can be used to denote a wildcard. |
def UM.Settings.ContainerRegistry.ContainerRegistry.getContainerForMimeType | ( | cls, | |
mime_type | |||
) |
Get the container type corresponding to a certain mime type.
mime_type | The mime type to get the container type for. |
def UM.Settings.ContainerRegistry.ContainerRegistry.getContainerTypes | ( | cls | ) |
Get all the registered container types.
Optional[MimeType] UM.Settings.ContainerRegistry.ContainerRegistry.getMimeTypeForContainer | ( | cls, | |
type | container_type | ||
) |
Retrieve the mime type corresponding to a certain container type.
container_type | The type of container to get the mime type for. |
bool UM.Settings.ContainerRegistry.ContainerRegistry.isLoaded | ( | self, | |
str | container_id | ||
) |
Returns whether a container is completely loaded or not.
If only its metadata is known, it is not yet completely loaded.
bool UM.Settings.ContainerRegistry.ContainerRegistry.isReadOnly | ( | self, | |
str | container_id | ||
) |
Returns whether a profile is read-only or not.
Whether it is read-only depends on the source where the container is obtained from.
Reimplemented from UM.Settings.Interfaces.ContainerRegistryInterface.
None UM.Settings.ContainerRegistry.ContainerRegistry.load | ( | self | ) |
Load all available definition containers, instance containers and container stacks.
str UM.Settings.ContainerRegistry.ContainerRegistry.uniqueName | ( | self, | |
str | original | ||
) |
Creates a new unique name for a container that doesn't exist yet.
It tries if the original name you provide exists, and if it doesn't it'll add a " #1" or " #2" after the name to make it unique.
original | The original name that may not be unique. |
|
static |