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/VersionUpgrade34to35 | |
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/VersionUpgrade34to35')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade34to35/VersionUpgrade34to35.py | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade34to35/VersionUpgrade34to35.py b/plugins/VersionUpgrade/VersionUpgrade34to35/VersionUpgrade34to35.py index 8e45d7cf73..30dae3883f 100644 --- a/plugins/VersionUpgrade/VersionUpgrade34to35/VersionUpgrade34to35.py +++ b/plugins/VersionUpgrade/VersionUpgrade34to35/VersionUpgrade34to35.py @@ -63,24 +63,6 @@ _RENAMED_MATERIAL_PROFILES = { ## Upgrades configurations from the state they were in at version 3.4 to the # state they should be in at version 3.5. class VersionUpgrade34to35(VersionUpgrade): - ## Gets the version number from a CFG file in Uranium's 3.4 format. - # - # Since the format may change, this is implemented for the 3.4 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 Preferences to have the new version number. def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: parser = configparser.ConfigParser(interpolation = None) |