25 Commits

Author SHA1 Message Date
Ghostkeeper
8ec7d6dba3
Fix type issues in old version upgrade plug-ins
The one actual change was this: To give a KeyError when stuff can't be found in a dictionary, rather than returning None there and then getting a TypeError later.

Contributes to issue CURA-5936.
2018-11-14 13:56:46 +01:00
Ghostkeeper
b67d8d4103
Fix type of fallback variable
These have to be strings because the configparser getter can only return strings.

Contributes to issue CURA-5936.
2018-11-14 13:46:13 +01:00
Ghostkeeper
ae2b312472
Add typing for all version upgrade plug-ins
Hopefully we'll take this typing along when we next copy-paste the stuffs.

Contributes to issue CURA-5936.
2018-11-14 13:41:23 +01:00
Ghostkeeper
4c6744b6fc
Code style: Space around binary operators
I just looked for lines with interpolation = None because I was looking for another possible bug, but fixing this in the meanwhile too.
2018-10-10 14:28:50 +02:00
Ghostkeeper
54a03723ab
Set encoding correctly when opening files everywhere
Otherwise the encoding is interpreted differently on Windows and Mac.
2018-06-11 11:09:07 +02:00
Lipu Fei
7dfc1a4aa7 Add encoding='utf-8' for text file reading
CURA-4875

When encoding is not provided, the behaviour is system dependent and it
can break on OS X.
2018-01-29 12:29:20 +01:00
Mark
9a193ad5c5 Changing AGPLv3 to LGPLv3 2017-09-28 13:00:43 +02:00
Lipu Fei
40d70b5f39 Fix version upgrade for project loading
CURA-3756
2017-05-16 14:38:27 +02:00
Ghostkeeper
55b2392a1d
Load setting version from metadata
I'm not really awake today, am I? The functionality happened to still work because of how our real data is structured right now, but the tests still failed. Those are successful now.

Contributes to issue CURA-3427.
2017-05-12 14:55:19 +02:00
Ghostkeeper
9820dac4a6
Actually use setting_version to get the setting version number
This was sort of hidden because we've always incremented the normal version number up until now.

Contributes to issue CURA-3427.
2017-05-12 14:51:44 +02:00
Ghostkeeper
6e01c6ba60
Initialise config_name
Just a mistake that I saw because my IDE warned me about this. If a variant in Cura 2.3 has no general/name keyword, then it would break here. Now it doesn't break any more and gives a nonsensical name.

Contributes to issue CURA-3427.
2017-05-11 17:33:46 +02:00
Ghostkeeper
0a84a181c4
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.
2017-05-11 17:31:37 +02:00
Simon Edwards
fb70eb6813 Merge branch 'master' into python_type_hinting 2017-01-17 08:42:55 +01:00
Simon Edwards
38a7ffa7da Some fixes regarding submodules and imports. 2017-01-16 21:35:28 +01:00
Simon Edwards
22012bdb1c Show the Z seam related settings after upgrade. CURA-2953 2016-12-14 13:52:07 +01:00
fieldOfView
9250520628 Fix variant before definition_changes 2016-12-14 13:08:18 +01:00
fieldOfView
dcae7575e4 Fix extraneous empty ("") container being added 2016-12-14 13:07:12 +01:00
fieldOfView
2c79efd8bd Fix [containers] items must be strings 2016-12-14 13:01:32 +01:00
fieldOfView
5718ca7852 Make sure definition_changes containers are not upgraded to stacks 2016-12-13 12:04:04 +01:00
Simon Edwards
81ffc3ae4b Import 'os' directly because we use it directly, even though it still works with out it.
CURA-2953
2016-12-08 15:10:52 +01:00
Arjen Hiemstra
d3f58a049b Add missing ":" 2016-12-08 13:22:24 +01:00
Arjen Hiemstra
c212014d88 Fix VersionUpgrade to handle both formats of ContainerStack files
Contributes to CURA-3098
2016-12-08 13:16:37 +01:00
Simon Edwards
e1d7a9faec Properly support the extrauder trains.
CURA-2953 Version upgrade 2.3 to 2.4
2016-12-06 17:03:35 +01:00
Simon Edwards
724cc99f59 Make things neater.
CURA-2953 Version upgrade 2.3 to 2.4
2016-12-05 13:31:24 +01:00
Simon Edwards
3d9c27a7f7 CURA-2953 Version upgrade 2.3 to 2.4 2016-12-05 11:00:33 +01:00