mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 12:03:57 -06:00
Add 'connect_group_name' to 'group_name' rename to version-upgrade. [CURA-6153]
This commit is contained in:
parent
954fdb20ad
commit
435c8deded
1 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,7 @@ import io
|
||||||
from UM.VersionUpgrade import VersionUpgrade
|
from UM.VersionUpgrade import VersionUpgrade
|
||||||
from cura.PrinterOutputDevice import ConnectionType
|
from cura.PrinterOutputDevice import ConnectionType
|
||||||
deleted_settings = {"bridge_wall_max_overhang"} # type: Set[str]
|
deleted_settings = {"bridge_wall_max_overhang"} # type: Set[str]
|
||||||
|
renamed_configurations = {"connect_group_name": "group_name"} # type: Dict[str, str]
|
||||||
|
|
||||||
|
|
||||||
class VersionUpgrade35to40(VersionUpgrade):
|
class VersionUpgrade35to40(VersionUpgrade):
|
||||||
|
@ -20,6 +21,13 @@ class VersionUpgrade35to40(VersionUpgrade):
|
||||||
# Set the connection type if um_network_key or the octoprint key is set.
|
# Set the connection type if um_network_key or the octoprint key is set.
|
||||||
parser["metadata"]["connection_type"] = str(ConnectionType.NetworkConnection.value)
|
parser["metadata"]["connection_type"] = str(ConnectionType.NetworkConnection.value)
|
||||||
|
|
||||||
|
if "metadata" in parser:
|
||||||
|
for old_name, new_name in renamed_configurations.items():
|
||||||
|
if old_name not in parser["metadata"]:
|
||||||
|
continue
|
||||||
|
parser["metadata"][new_name] = parser["metadata"][old_name]
|
||||||
|
del parser["metadata"][old_name]
|
||||||
|
|
||||||
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