diff options
author | Jaime van Kessel <nallath@gmail.com> | 2020-04-22 12:30:35 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2020-04-22 12:30:35 +0300 |
commit | de7e3f824d301bce00f049b761e27303b2756a37 (patch) | |
tree | 6fa940a0bf91ca5fa4e35bbe924f6ca1bfc1d7dd /plugins/VersionUpgrade/VersionUpgrade33to34 | |
parent | ad6f837f44748f9740bc00341e0810fddb1f113f (diff) |
Move the getCfgVersion to base version upgrade
They can still be overridden, but in the current situation they were
all the same...
Diffstat (limited to 'plugins/VersionUpgrade/VersionUpgrade33to34')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py b/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py index 704ede02d6..acca39942d 100644 --- a/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py +++ b/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py @@ -14,24 +14,6 @@ _renamed_settings = { ## Upgrades configurations from the state they were in at version 3.3 to the # state they should be in at version 3.4. class VersionUpgrade33to34(VersionUpgrade): - ## Gets the version number from a CFG file in Uranium's 3.3 format. - # - # Since the format may change, this is implemented for the 3.3 format only - # and needs to be included in the version upgrade system rather than - # globally in Uranium. - # - # \param serialised The serialised form of a CFG file. - # \return The version number stored in the CFG file. - # \raises ValueError The format of the version number in the file is - # incorrect. - # \raises KeyError The format of the file is incorrect. - def getCfgVersion(self, serialised: str) -> int: - parser = configparser.ConfigParser(interpolation = None) - parser.read_string(serialised) - format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised. - setting_version = int(parser.get("metadata", "setting_version", fallback = "0")) - return format_version * 1000000 + setting_version - ## Upgrades instance containers to have the new version # number. def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: |