Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2021-09-13 15:57:40 +0300
committerJaime van Kessel <nallath@gmail.com>2021-09-13 15:57:40 +0300
commitcfb147853ef82534e2b1a8f7106565477955107e (patch)
treecb6ad3b50457b0cf65d2cce5b23a467ebc53116b /plugins/VersionUpgrade
parent9f3aef02a2314e9039e931bb0edabaffd4ab8fea (diff)
parent8ed2e7bd447cb1d19a74e71481f10838340c6758 (diff)
Merge branch 'master' of github.com:Ultimaker/Cura into libArachne_rebased
Diffstat (limited to 'plugins/VersionUpgrade')
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py2
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade49to410/VersionUpgrade49to410.py19
-rw-r--r--plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py1
3 files changed, 21 insertions, 1 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py b/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py
index 73d6578c9b..50aa726044 100644
--- a/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py
+++ b/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py
@@ -122,7 +122,7 @@ class VersionUpgrade42to43(VersionUpgrade):
# Update version number.
parser["metadata"]["setting_version"] = "9"
# Handle changes for the imade3d jellybox. The machine was split up into parts (eg; a 2 fan version and a single
- # fan version. Perviously it used variants for this. The only upgrade we can do here is strip that variant.
+ # fan version. Previously it used variants for this. The only upgrade we can do here is strip that variant.
# This is because we only upgrade per stack (and to fully do these changes, we'd need to switch out something
# in the global container based on changes made to the extruder stack)
if parser["containers"]["6"] == "imade3d_jellybox_extruder_0":
diff --git a/plugins/VersionUpgrade/VersionUpgrade49to410/VersionUpgrade49to410.py b/plugins/VersionUpgrade/VersionUpgrade49to410/VersionUpgrade49to410.py
index 7d9186e06b..b04c396a00 100644
--- a/plugins/VersionUpgrade/VersionUpgrade49to410/VersionUpgrade49to410.py
+++ b/plugins/VersionUpgrade/VersionUpgrade49to410/VersionUpgrade49to410.py
@@ -104,6 +104,25 @@ class VersionUpgrade49to410(VersionUpgrade):
"g" : "D060"
}
+ def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
+ """
+ Upgrades preferences to have the new version number.
+ :param serialized: The original contents of the preferences file.
+ :param filename: The file name of the preferences file.
+ :return: A list of new file names, and a list of the new contents for
+ those files.
+ """
+ parser = configparser.ConfigParser(interpolation = None)
+ parser.read_string(serialized)
+
+ # Update version number.
+ parser["metadata"]["setting_version"] = "17"
+
+ result = io.StringIO()
+ parser.write(result)
+ return [filename], [result.getvalue()]
+
+
def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]:
"""Upgrades instance containers to have the new version number.
diff --git a/plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py b/plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py
index 0d5128473f..7c8dd424d1 100644
--- a/plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py
+++ b/plugins/VersionUpgrade/VersionUpgrade49to410/__init__.py
@@ -21,6 +21,7 @@ def getMetaData() -> Dict[str, Any]:
("quality_changes", 4000016): ("quality_changes", 4000017, upgrade.upgradeInstanceContainer),
("quality", 4000016): ("quality", 4000017, upgrade.upgradeInstanceContainer),
("user", 4000016): ("user", 4000017, upgrade.upgradeInstanceContainer),
+ ("preferences", 7000016): ("preferences", 7000017, upgrade.upgradePreferences),
},
"sources": {
"machine_stack": {