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:
authorGhostkeeper <rubend@tutanota.com>2017-05-11 18:31:37 +0300
committerGhostkeeper <rubend@tutanota.com>2017-05-11 18:31:37 +0300
commit0a84a181c466957a6c2980f694abb657b333c53f (patch)
tree339f00911ea76128cbbfb41525a4b21e35b23330 /plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py
parent639e86ca597464eadf1826193c0c4adfd0ddb948 (diff)
Track cfg version numbers with major-minor, sorta
We now have a (format) version and a setting version. Ideally we'd like major-minor version numbers in our profiles. However, introducing major-minor version numbers requires substantial changes to the version upgrade manager to compare version numbers, find a path towards the current version, or even keeping track of the current version. Therefore we just collapse the two version numbers into one: Multiply the major version number by a million and you'll never exceed it in the minor versioning. The only problem is that we now have to update the versioning for all of our three upgrade plug-ins, because they all need to know locally how to find the version number of their file types (because the upgrade manager has no knowledge of the file types) and they have no access to each other because a plug-in may be disabled. Contributes to issue CURA-3427.
Diffstat (limited to 'plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py')
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py b/plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py
index b28124f16b..7a4ff70fb7 100644
--- a/plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py
+++ b/plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py
@@ -144,4 +144,6 @@ class VersionUpgrade22to24(VersionUpgrade):
def getCfgVersion(self, serialised):
parser = configparser.ConfigParser(interpolation = None)
parser.read_string(serialised)
- return int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
+ 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("general", "version", fallback = 0))
+ return format_version * 1000000 + setting_version