diff options
author | Ghostkeeper <rubend@tutanota.com> | 2018-05-29 12:51:54 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2018-05-29 13:51:31 +0300 |
commit | db16a6275f43ce9a51326ea9ddcaa80f8ab3a4c9 (patch) | |
tree | 2fb639d73494fc780f582f235b8a2672d2200991 /plugins/VersionUpgrade/VersionUpgrade33to34 | |
parent | ab2503834bda73e51ce4950d91f5739f5ae9bdd2 (diff) |
Add version upgrade for infill_hollow -> infill_support
The functionality is more or less the same, so in an attempt to keep people's profiles as similar as possible we translate this setting to the newer implementation.
Diffstat (limited to 'plugins/VersionUpgrade/VersionUpgrade33to34')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py b/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py index 17abace547..16f17c5e36 100644 --- a/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py +++ b/plugins/VersionUpgrade/VersionUpgrade33to34/VersionUpgrade33to34.py @@ -6,6 +6,9 @@ import io #To serialise the preference files afterwards. from UM.VersionUpgrade import VersionUpgrade #We're inheriting from this. +_renamed_settings = { + "infill_hollow": "infill_support_enabled" +} ## Upgrades configurations from the state they were in at version 3.3 to the # state they should be in at version 3.4. @@ -38,6 +41,13 @@ class VersionUpgrade33to34(VersionUpgrade): # Update version number. parser["general"]["version"] = "4" + #Renamed settings. + if "values" in parser: + for original, replacement in _renamed_settings.items(): + if original in parser["value"]: + parser["value"][replacement] = parser["value"][original] + del parser["value"][original] + result = io.StringIO() parser.write(result) - return [filename], [result.getvalue()] + return [filename], [result.getvalue()]
\ No newline at end of file |