Uranium
Application Framework
|
A container for SettingDefinition objects. More...
Public Member Functions | |
None | __init__ (self, str container_id, i18nCatalog i18n_catalog=None, QObject parent=None, *args, **kwargs) |
Constructor. More... | |
None | __setattr__ (self, str name, Any value) |
Reimplement setattr so we can make sure the definition remains unchanged after creation. More... | |
Tuple[str, Optional[i18nCatalog]] | __getnewargs__ (self) |
For pickle support. | |
Dict[str, Any] | __getstate__ (self) |
For pickle support. | |
None | __setstate__ (self, Dict[str, Any] state) |
For pickle support. | |
str | getId (self) |
str | getName (self) |
bool | isReadOnly (self) |
None | setReadOnly (self, bool read_only) |
str | getPath (self) |
None | setPath (self, str path) |
Dict[str, Any] | getMetaData (self) |
List[SettingDefinition] | definitions (self) |
List[str] | getInheritedFiles (self) |
Gets all ancestors of this definition container. More... | |
Set[str] | getAllKeys (self) |
Any | getMetaDataEntry (self, str entry, Any default=None) |
Any | getProperty (self, str key, str property_name, PropertyEvaluationContext context=None) |
Any | hasProperty (self, str key, str property_name, bool ignore_inherited=False) |
str | serialize (self, Optional[set] ignored_metadata_keys=None) |
Optional[str] | getConfigurationTypeFromSerialized (cls, str serialized) |
Gets the configuration type of the given serialized data. More... | |
Tuple[Dict[str, Any], bool] | readAndValidateSerialized (self, str serialized) |
Optional[int] | getVersionFromSerialized (cls, str serialized) |
Gets the version of the given serialized data. More... | |
None | addDefinition (self, SettingDefinition definition) |
Add a setting definition instance if it doesn't exist yet. More... | |
str | deserialize (self, str serialized, Optional[str] file_name=None) |
List[Dict[str, Any]] | deserializeMetadata (cls, str serialized, str container_id) |
Gets the metadata of a definition container from a serialised format. More... | |
List[SettingDefinition] | findDefinitions (self, **Any kwargs) |
Find definitions matching certain criteria. More... | |
int | getLoadingPriority (cls) |
str | __str__ (self) |
Simple short string representation for debugging purposes. More... | |
![]() | |
None | __init__ (self) |
str | getPluginId (self) |
None | setPluginId (self, str plugin_id) |
None | setVersion (self, str version) |
str | getVersion (self) |
Static Public Attributes | |
int | Version = 2 |
id = pyqtProperty(str, fget = getId, constant = True) | |
name = pyqtProperty(str, fget = getName, constant = True) | |
readOnly = pyqtProperty(bool, fget = isReadOnly, constant = True) | |
metaData = pyqtProperty("QVariantMap", fget = getMetaData, constant = True) | |
propertyChanged = Signal() | |
This signal is unused since the definition container is immutable, but is provided for API consistency. More... | |
metaDataChanged = Signal() | |
A container for SettingDefinition objects.
None UM.Settings.DefinitionContainer.DefinitionContainer.__init__ | ( | self, | |
str | container_id, | ||
i18nCatalog | i18n_catalog = None , |
||
QObject | parent = None , |
||
* | args, | ||
** | kwargs | ||
) |
Constructor.
container_id | A unique, machine readable/writable ID for this container. |
None UM.Settings.DefinitionContainer.DefinitionContainer.__setattr__ | ( | self, | |
str | name, | ||
Any | value | ||
) |
Reimplement setattr so we can make sure the definition remains unchanged after creation.
str UM.Settings.DefinitionContainer.DefinitionContainer.__str__ | ( | self | ) |
Simple short string representation for debugging purposes.
None UM.Settings.DefinitionContainer.DefinitionContainer.addDefinition | ( | self, | |
SettingDefinition | definition | ||
) |
Add a setting definition instance if it doesn't exist yet.
Warning: this might not work when there are relationships higher up in the stack.
str UM.Settings.DefinitionContainer.DefinitionContainer.deserialize | ( | self, | |
str | serialized, | ||
Optional[str] | file_name = None |
||
) |
Reimplemented from ContainerInterface
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
List[Dict[str, Any]] UM.Settings.DefinitionContainer.DefinitionContainer.deserializeMetadata | ( | cls, | |
str | serialized, | ||
str | container_id | ||
) |
Gets the metadata of a definition container from a serialised format.
This parses the entire JSON document and only extracts the metadata from it.
serialized | A JSON document, serialised as a string. |
container_id | The ID of the container (as obtained from the file name). |
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
List[SettingDefinition] UM.Settings.DefinitionContainer.DefinitionContainer.findDefinitions | ( | self, | |
**Any | kwargs | ||
) |
Find definitions matching certain criteria.
kwargs | A dictionary of keyword arguments containing key-value pairs which should match properties of the definition. |
Set[str] UM.Settings.DefinitionContainer.DefinitionContainer.getAllKeys | ( | self | ) |
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
Optional[str] UM.Settings.DefinitionContainer.DefinitionContainer.getConfigurationTypeFromSerialized | ( | cls, | |
str | serialized | ||
) |
Gets the configuration type of the given serialized data.
(used by __updateSerialized())
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
str UM.Settings.DefinitionContainer.DefinitionContainer.getId | ( | self | ) |
Reimplemented from ContainerInterface
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
List[str] UM.Settings.DefinitionContainer.DefinitionContainer.getInheritedFiles | ( | self | ) |
Gets all ancestors of this definition container.
This returns the definition in the "inherits" property of this container, and the definition in its "inherits" property, and so on. The ancestors are returned in order from parent to grand-grand-grand-...-grandparent, normally ending in a "root" container.
Dict[str, Any] UM.Settings.DefinitionContainer.DefinitionContainer.getMetaData | ( | self | ) |
Reimplemented from ContainerInterface
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
Any UM.Settings.DefinitionContainer.DefinitionContainer.getMetaDataEntry | ( | self, | |
str | entry, | ||
Any | default = None |
||
) |
Reimplemented from ContainerInterface
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
str UM.Settings.DefinitionContainer.DefinitionContainer.getName | ( | self | ) |
Reimplemented from ContainerInterface
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
str UM.Settings.DefinitionContainer.DefinitionContainer.getPath | ( | self | ) |
Reimplemented from ContainerInterface
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
Any UM.Settings.DefinitionContainer.DefinitionContainer.getProperty | ( | self, | |
str | key, | ||
str | property_name, | ||
PropertyEvaluationContext | context = None |
||
) |
Reimplemented from ContainerInterface.
Optional[int] UM.Settings.DefinitionContainer.DefinitionContainer.getVersionFromSerialized | ( | cls, | |
str | serialized | ||
) |
Gets the version of the given serialized data.
(used by __updateSerialized())
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
Any UM.Settings.DefinitionContainer.DefinitionContainer.hasProperty | ( | self, | |
str | key, | ||
str | property_name, | ||
bool | ignore_inherited = False |
||
) |
Reimplemented from ContainerInterface
bool UM.Settings.DefinitionContainer.DefinitionContainer.isReadOnly | ( | self | ) |
Reimplemented from ContainerInterface
str UM.Settings.DefinitionContainer.DefinitionContainer.serialize | ( | self, | |
Optional[set] | ignored_metadata_keys = None |
||
) |
TODO: This implementation flattens the definition container, since the data about inheritance and overrides was lost when deserialising.
Reimplemented from ContainerInterface
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
None UM.Settings.DefinitionContainer.DefinitionContainer.setPath | ( | self, | |
str | path | ||
) |
Reimplemented from ContainerInterface
Reimplemented from UM.Settings.Interfaces.ContainerInterface.
|
static |
This signal is unused since the definition container is immutable, but is provided for API consistency.