16 Commits

Author SHA1 Message Date
Dmitry Gribenchuk
8116df6c21
cleanup unused import and fix comment space 2023-12-13 20:10:28 +02:00
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
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
Mark
9a193ad5c5 Changing AGPLv3 to LGPLv3 2017-09-28 13:00:43 +02:00
Ghostkeeper
af86375ba3
Output arrays of files rather than a single file
This is needed because the version upgrade system now allows for a version upgrader to output any number of files.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
8f5e56c66e
Make documentation specify filename without extension
Contributes to issue CURA-844.
2016-07-07 15:22:27 +02:00
Ghostkeeper
e6efba3868
Make version upgrade also translate file names
This was required since Cura 2.1 produced files with the same filename (bar extension). This then resulted in two containers with the same ID. If you had bad luck, an instance container was chosen as global container (depending on which was first in the unordered dictionary). This gives the current settings the postfix _current_settings, fixing that issue.

Contributes to issue CURA-844.
2016-07-07 15:13:58 +02:00
Ghostkeeper
88b36ad3d7 Make translateSettingName use dictionary look-up
This solution is a bit neater in code. It makes the function perform a single purpose, since it no longer translates a list of setting names but just one. Also it now neatly puts the translations in a separate, easy-to-modify dict. Only disadvantage is when simple key look-up is not sufficient, such as when renaming lots of settings at once, where substring matching would make the code a bit shorter. But we shouldn't do such a rename anyway.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
d1188899a7 Translate active machine setting
It was in machines/active_instance. Now it's in cura/active_machine. The setting value remains the same.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
922b0df60b Don't read machine instances as preferences
Machine instances have the exact same file structure as preferences, except that machine instances require a name field (was already correctly implemented), but preferences didn't require it. This now forbids preferences to have a name field, so that the distinction between the two can be made.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
20d776c0d4 Fix joining strings on comma
The call worked a bit differently.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
a5abfe29cd Fix call to translateSettingNames
It's two modules deeper!

Bit of weird magic due to how our plug-in import system works.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
ec5aee253d Also increment the version number
Of course. Duh.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
e02a633ef2 Add preferences converter
Currently it removes the expanded categories setting, and translates the setting names in the visibility.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
242559bd7e Remove preferences upgrade from 2.1->2.2
No preferences will need to be upgraded.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
2f4e63a944 Add boilerplate version upgrade plug-in
This plug-in does nothing at the moment. It merely says that it is able to upgrade configuration from version 2.1 to 2.2, but then raises exceptions when you actually try to use it. This is by design. I will now implement the functions that do the conversion.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00