Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2020-04-22 12:30:35 +0300
committerJaime van Kessel <nallath@gmail.com>2020-04-22 12:30:35 +0300
commitde7e3f824d301bce00f049b761e27303b2756a37 (patch)
tree6fa940a0bf91ca5fa4e35bbe924f6ca1bfc1d7dd /plugins/VersionUpgrade/VersionUpgrade25to26
parentad6f837f44748f9740bc00341e0810fddb1f113f (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/VersionUpgrade25to26')
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py19
1 files changed, 1 insertions, 18 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py b/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py
index 6dbcfebc46..2cb0cf3ba4 100644
--- a/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py
+++ b/plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py
@@ -19,6 +19,7 @@ _split_settings = { #These settings should be copied to all settings it was spli
"support_interface_line_distance": {"support_roof_line_distance", "support_bottom_line_distance"}
} # type: Dict[str, Set[str]]
+
## A collection of functions that convert the configuration of the user in Cura
# 2.5 to a configuration for Cura 2.6.
#
@@ -28,24 +29,6 @@ class VersionUpgrade25to26(VersionUpgrade):
super().__init__()
self._current_fdm_printer_count = 2
- ## Gets the version number from a CFG file in Uranium's 2.5 format.
- #
- # Since the format may change, this is implemented for the 2.5 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 the preferences file from version 2.5 to 2.6.
#
# \param serialised The serialised form of a preferences file.