From 5c49adc52e26584c09b850f2ef649093e5a9b628 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 14 Sep 2016 15:37:12 +0200 Subject: [PATCH 1/2] Also return tuple if upgrading failed It is checked if the file data is None or empty (the upgrade is then considered 'failed'). But to unpack the file data, it needs to be a tuple. Contributes to issue CURA-844. --- plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py b/plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py index ff404c0398..a09ac4f3d7 100644 --- a/plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py +++ b/plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py @@ -80,7 +80,7 @@ class Profile: import VersionUpgrade21to22 # Import here to prevent circular dependencies. if self._name == "Current settings": - return None #Can't upgrade these, because the new current profile needs to specify the definition ID and the old file only had the machine instance, not the definition. + return None, None #Can't upgrade these, because the new current profile needs to specify the definition ID and the old file only had the machine instance, not the definition. config = configparser.ConfigParser(interpolation = None) From 5c5d1888894d541eb8ff8c092daf5bf1170ff7fd Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 14 Sep 2016 15:41:22 +0200 Subject: [PATCH 2/2] Remove support_area_smoothing setting Contributes to issue CURA-2296. --- .../VersionUpgrade21to22/VersionUpgrade21to22.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py b/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py index 0b021467c4..286667f5b0 100644 --- a/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py +++ b/plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py @@ -118,6 +118,12 @@ _profile_translations = { "tpu_0.6_fast": "um2p_tpu_0.6_fast" } +## Settings that are no longer in the new version. +_removed_settings = { + "fill_perimeter_gaps", + "support_area_smoothing" +} + ## How to translate setting names from the old version to the new. _setting_name_translations = { "remove_overlapping_walls_0_enabled": "travel_compensate_overlapping_walls_0_enabled", @@ -385,7 +391,7 @@ class VersionUpgrade21to22(VersionUpgrade): @staticmethod def translateSettings(settings): for key, value in settings.items(): - if key == "fill_perimeter_gaps": #Setting is removed. + if key in _removed_settings: del settings[key] elif key == "retraction_combing": #Combing was made into an enum instead of a boolean. settings[key] = "off" if (value == "False") else "all"