Uranium
Application Framework
|
Public Member Functions | |
__init__ (self) | |
int | getCfgVersion (self, str serialised) |
![]() | |
None | __init__ (self, *args, **kwags) |
str | getId (self) |
None | setPluginId (self, str plugin_id) |
None | setMetaData (self, Dict[str, Any] metadata) |
Dict[str, Any] | getMetaData (self) |
str | getPluginId (self) |
None | setVersion (self, str version) |
str | getVersion (self) |
Protected Attributes | |
_version_regex = re.compile(r"\nversion ?= ?(\d+)") | |
_setting_version_regex = re.compile(r"\nsetting_version ?= ?(\d+)") | |
![]() | |
_plugin_id = None | |
_version = None | |
dict | _metadata = {} |
_name = None | |
A type of plug-in that upgrades the configuration from an old file format to a newer one. Each version upgrade plug-in can convert from some combinations of configuration types and versions to other types and versions. Which types and versions they can convert from though is completely free, and the conversion functions are referred to by the metadata of the plug-in. That's why this interface is basically empty. A plug-in object is needed for the plug-in registry.
UM.VersionUpgrade.VersionUpgrade.__init__ | ( | self | ) |
Initialises a version upgrade plugin instance.
int UM.VersionUpgrade.VersionUpgrade.getCfgVersion | ( | self, | |
str | serialised ) |
Gets the version number from a config file. In all config files that concern this version upgrade, the version number is stored in general/version, so get the data from that key. :param serialised: The contents of a config file. :return: The version number of that config file.