mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 06:03:57 -06:00
Fix empty containers in stack upgrade
This commit is contained in:
parent
8522fbf6f5
commit
74eb17203d
1 changed files with 14 additions and 0 deletions
|
@ -45,6 +45,15 @@ _OLD_NOT_SUPPORTED_PROFILES = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# Some containers have their specific empty containers, those need to be set correctly.
|
||||||
|
_EMPTY_CONTAINER_DICT = {
|
||||||
|
"1": "empty_quality_changes",
|
||||||
|
"2": "empty_quality",
|
||||||
|
"3": "empty_material",
|
||||||
|
"4": "empty_variant",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class VersionUpgrade30to31(VersionUpgrade):
|
class VersionUpgrade30to31(VersionUpgrade):
|
||||||
## Gets the version number from a CFG file in Uranium's 3.0 format.
|
## Gets the version number from a CFG file in Uranium's 3.0 format.
|
||||||
#
|
#
|
||||||
|
@ -126,6 +135,11 @@ class VersionUpgrade30to31(VersionUpgrade):
|
||||||
if quality_profile_id in _OLD_NOT_SUPPORTED_PROFILES:
|
if quality_profile_id in _OLD_NOT_SUPPORTED_PROFILES:
|
||||||
parser["containers"]["2"] = "empty_quality"
|
parser["containers"]["2"] = "empty_quality"
|
||||||
|
|
||||||
|
# fix empty containers
|
||||||
|
for key, specific_empty_container in _EMPTY_CONTAINER_DICT:
|
||||||
|
if parser.has_option("containers", key) and parser["containers"][key] == "empty":
|
||||||
|
parser["containers"][key] = specific_empty_container
|
||||||
|
|
||||||
# Update version numbers
|
# Update version numbers
|
||||||
if "general" not in parser:
|
if "general" not in parser:
|
||||||
parser["general"] = {}
|
parser["general"] = {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue