diff options
author | jelle Spijker <j.spijker@ultimaker.com> | 2020-06-29 17:07:34 +0300 |
---|---|---|
committer | Jelle Spijker <spijker.jelle@gmail.com> | 2020-06-29 17:07:34 +0300 |
commit | 8af4e0d05ad441f2de597b5e78afeff115c70a37 (patch) | |
tree | 5a493d71e27d72015be8e80e95e4e83397cdf4ea /plugins/VersionUpgrade | |
parent | 7d0a05176fef490987727b7f8f17815baf3f487e (diff) |
Remove spaghetti settings from 462 visible_settings when upgrading
Part of CURA-7199
Diffstat (limited to 'plugins/VersionUpgrade')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py index 7bee545c16..e5fa05bd24 100644 --- a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py +++ b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py @@ -2,7 +2,7 @@ # Cura is released under the terms of the LGPLv3 or higher. import configparser -from typing import Tuple, List, Dict +from typing import Tuple, List, Dict, Set import io from UM.VersionUpgrade import VersionUpgrade @@ -10,8 +10,17 @@ from UM.VersionUpgrade import VersionUpgrade # Renamed definition files _RENAMED_DEFINITION_DICT = { "dagoma_discoeasy200": "dagoma_discoeasy200_bicolor", -} # type: Dict[str, str] - +} # type: Dict[str, str] + +_removed_settings = { + "spaghetti_infill_enabled", + "spaghetti_infill_stepped", + "spaghetti_max_infill_angle", + "spaghetti_max_height", + "spaghetti_inset", + "spaghetti_flow", + "spaghetti_infill_extra_volume" +} # type: Set[str] class VersionUpgrade462to47(VersionUpgrade): def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: @@ -27,6 +36,11 @@ class VersionUpgrade462to47(VersionUpgrade): # Update version number. parser["metadata"]["setting_version"] = "15" + + # Remove deleted settings from the visible settings list. + if "general" in parser and "visible_settings" in parser["general"]: + parser["general"]["visible_settings"] = ";".join( + set(parser["general"]["visible_settings"].split(";")).difference(_removed_settings)) result = io.StringIO() parser.write(result) |