|
@@ -33,23 +33,6 @@ _renamed_i18n = {
|
|
|
|
|
|
|
|
|
class VersionUpgrade27to30(VersionUpgrade):
|
|
|
- ## Gets the version number from a CFG file in Uranium's 2.7 format.
|
|
|
- #
|
|
|
- # Since the format may change, this is implemented for the 2.7 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 a preferences file from version 2.7 to 3.0.
|
|
|
#
|