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/VersionUpgrade21to22 | |
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/VersionUpgrade21to22')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py b/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py index 536385b19d..c66f61596a 100644 --- a/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py +++ b/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py @@ -236,23 +236,11 @@ _variant_translations_materials = { } } # type: Dict[str, Dict[str, str]] + ## Converts configuration from Cura 2.1's file formats to Cura 2.2's. # # It converts the machine instances and profiles. class VersionUpgrade21to22(VersionUpgrade): - ## 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. - 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 ## Gets the fallback quality to use for a specific machine-variant-material # combination. |