mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Adjust VersionUpgrade to update support_infill_angle
This commit is contained in:
parent
1a4d491dd9
commit
6f3eea3c2c
1 changed files with 13 additions and 0 deletions
|
@ -18,6 +18,10 @@ _removed_settings = {
|
||||||
"start_layers_at_same_position"
|
"start_layers_at_same_position"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_renamed_settings = {
|
||||||
|
"support_infill_angle": "support_infill_angles"
|
||||||
|
} # type: Dict[str, str]
|
||||||
|
|
||||||
## Upgrades configurations from the state they were in at version 4.2 to the
|
## Upgrades configurations from the state they were in at version 4.2 to the
|
||||||
# state they should be in at version 4.3.
|
# state they should be in at version 4.3.
|
||||||
class VersionUpgrade42to43(VersionUpgrade):
|
class VersionUpgrade42to43(VersionUpgrade):
|
||||||
|
@ -62,10 +66,19 @@ class VersionUpgrade42to43(VersionUpgrade):
|
||||||
parser["metadata"]["setting_version"] = "9"
|
parser["metadata"]["setting_version"] = "9"
|
||||||
|
|
||||||
if "values" in parser:
|
if "values" in parser:
|
||||||
|
for old_name, new_name in _renamed_settings.items():
|
||||||
|
if old_name in parser["values"]:
|
||||||
|
parser["values"][new_name] = parser["values"][old_name]
|
||||||
|
del parser["values"][old_name]
|
||||||
for key in _removed_settings:
|
for key in _removed_settings:
|
||||||
if key in parser["values"]:
|
if key in parser["values"]:
|
||||||
del parser["values"][key]
|
del parser["values"][key]
|
||||||
|
|
||||||
|
parser["values"]["support_infill_angles"]["type"] = "[int]"
|
||||||
|
parser["values"]["support_infill_angles"]["default_value"] = "[ ]"
|
||||||
|
del parser["values"]["support_infill_angles"]["minimum_value"]
|
||||||
|
del parser["values"]["support_infill_angles"]["maximum_value"]
|
||||||
|
|
||||||
result = io.StringIO()
|
result = io.StringIO()
|
||||||
parser.write(result)
|
parser.write(result)
|
||||||
return [filename], [result.getvalue()]
|
return [filename], [result.getvalue()]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue