Regulates the upgrading of configuration from one application version to the next.
More...
|
"VersionUpgradeManager" | getInstance (cls) |
| Gets the instance of the VersionUpgradeManager, or creates one.
|
|
| __init__ (self) |
| Initialises the version upgrade manager.
|
|
| getStoragePaths (self, configuration_type) |
| Gets the paths where a specified type of file should be stored.
|
|
| setCurrentVersions (self, current_versions) |
| Changes the target versions to upgrade to.
|
|
| registerCurrentVersion (self, version_info, type_info) |
|
| upgrade (self) |
| Performs the version upgrades of all configuration files to the most recent version.
|
|
| upgradeExtraFile (self, storage_path, file_name, configuration_type) |
| Schedules an additional file for upgrading.
|
|
| copyVersionFolder (self, src_path, dest_path) |
|
| getFileVersion (self, configuration_type, file_data) |
| Gets the version of the given file data.
|
|
| updateFilesData (self, configuration_type, version, files_data, file_names_without_extension) |
|
|
| _addVersionUpgrade (self, version_upgrade_plugin) |
| Adds a version upgrade plug-in.
|
|
| _findShortestUpgradeRoutes (self) |
| Finds the next step to take to upgrade each combination of configuration type and version.
|
|
| _getFilesInDirectory (self, directory) |
| Get the filenames of all files in a specified directory.
|
|
| _getUpgradeTasks (self) |
| Gets all files that need to be upgraded.
|
|
| _storeOldFile (self, resource_directory, relative_path, old_version) |
| Stores an old version of a configuration file away.
|
|
| _upgradeFile (self, storage_path_absolute, configuration_file, old_configuration_type) |
| Upgrades a single file to any version in self._current_versions.
|
|
| _stripMimeTypeExtension (self, mime_type, file_name) |
|
Regulates the upgrading of configuration from one application version to the next.
The process of upgrading will take a look at all profiles, preferences and machine instances and check their version numbers. If they are older than the current version number of their respective type of file, an upgrade route will be planned for it in order to upgrade the file to the current version in as few conversions as possible.
To this end, the upgrade manager will maintain the shortest routes to the current version for each of the types of profiles and each old version it encounters. Once a shortest route is found, it is cached and can be re-used for all nodes along this route. This minimises the extra start-up time required for the conversions.
Old versions of the configuration are not deleted, but put in a folder next to the current (upgraded) versions, where they are never loaded again unless the user manually retrieves the files.
UM.VersionUpgradeManager.VersionUpgradeManager.upgradeExtraFile |
( |
|
self, |
|
|
|
storage_path, |
|
|
|
file_name, |
|
|
|
configuration_type |
|
) |
| |
Schedules an additional file for upgrading.
This method is intended to be called by upgrade plug-ins during upgrading, to make sure we also upgrade any extra files that should be added during the upgrade process. Note that the file is not immediately upgraded, but scheduled for upgrading. If this method is called while the upgrade()
function is still running, it will get upgraded at the end of that run. If it is called while the upgrade()
function is not running, it would get upgraded during the next call to upgrade()
.
- Parameters
-
storage_path | The path to where the specified type of file is stored. |
file_name | The path to the file to upgrade, relative to the storage path. |
configuration_type | The file type of the specified file. |