mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 16:57:51 -06:00
Remove preferences upgrade from 2.1->2.2
No preferences will need to be upgraded. Contributes to issue CURA-844.
This commit is contained in:
parent
b643fe8fd0
commit
242559bd7e
3 changed files with 1 additions and 36 deletions
|
@ -1,20 +0,0 @@
|
||||||
# Copyright (c) 2015 Ultimaker B.V.
|
|
||||||
# Cura is released under the terms of the AGPLv3 or higher.
|
|
||||||
|
|
||||||
## Creates a new preferences instance by parsing a serialised preferences file
|
|
||||||
# in version 2 of the file format.
|
|
||||||
#
|
|
||||||
# \param serialised The serialised form of a preferences file in version 2.
|
|
||||||
# \return A preferences instance, or None if the file format is incorrect.
|
|
||||||
def importVersion2(serialised):
|
|
||||||
return None #Not implemented yet.
|
|
||||||
|
|
||||||
## A representation of a preferences file used as intermediary form for
|
|
||||||
# conversion from one format to the other.
|
|
||||||
class Preferences:
|
|
||||||
## Serialises this preferences file as file format version 3.
|
|
||||||
#
|
|
||||||
# \return A serialised form of this preferences file, serialised in
|
|
||||||
# version 3 of the file format.
|
|
||||||
def exportVersion3():
|
|
||||||
raise Exception("Not implemented yet.")
|
|
|
@ -9,7 +9,7 @@ from . import Profile #To upgrade profiles.
|
||||||
|
|
||||||
## Converts configuration from Cura 2.1's file formats to Cura 2.2's.
|
## Converts configuration from Cura 2.1's file formats to Cura 2.2's.
|
||||||
#
|
#
|
||||||
# It converts the machine instances, preferences and profiles.
|
# It converts the machine instances and profiles.
|
||||||
class VersionUpgrade21to22(VersionUpgrade):
|
class VersionUpgrade21to22(VersionUpgrade):
|
||||||
## Converts machine instances from format version 1 to version 2.
|
## Converts machine instances from format version 1 to version 2.
|
||||||
#
|
#
|
||||||
|
@ -22,17 +22,6 @@ class VersionUpgrade21to22(VersionUpgrade):
|
||||||
return None
|
return None
|
||||||
return machine_instance.exportVersion2()
|
return machine_instance.exportVersion2()
|
||||||
|
|
||||||
## Converts preferences from format version 2 to version 3.
|
|
||||||
#
|
|
||||||
# \param serialised The serialised preferences file in version 2.
|
|
||||||
# \return The serialised preferences file in version 3, or None if the
|
|
||||||
# input was not of the correct format.
|
|
||||||
def upgradePreferences(self, serialised):
|
|
||||||
preferences = Preferences.importVersion2(serialised)
|
|
||||||
if not preferences: #Invalid file format.
|
|
||||||
return None
|
|
||||||
return preferences.exportVersion3()
|
|
||||||
|
|
||||||
## Converts profiles from format version 1 to version 2.
|
## Converts profiles from format version 1 to version 2.
|
||||||
#
|
#
|
||||||
# \param serialised The serialised profile in version 1.
|
# \param serialised The serialised profile in version 1.
|
||||||
|
|
|
@ -20,10 +20,6 @@ def getMetaData():
|
||||||
"from": 1,
|
"from": 1,
|
||||||
"to": 2
|
"to": 2
|
||||||
},
|
},
|
||||||
"preferences": {
|
|
||||||
"from": 2,
|
|
||||||
"to": 3
|
|
||||||
},
|
|
||||||
"machine_instance": {
|
"machine_instance": {
|
||||||
"from": 1,
|
"from": 1,
|
||||||
"to": 2
|
"to": 2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue