mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-10 21:59:01 +08:00
Use preferences upgrader
Instead of the placeholder. Contributes to issue CURA-844.
This commit is contained in:
parent
ec5aee253d
commit
51aa82bd6c
@ -6,6 +6,7 @@ import configparser #To get version numbers from config files.
|
||||
from UM.VersionUpgrade import VersionUpgrade # Superclass of the plugin.
|
||||
|
||||
from . import MachineInstance # To upgrade machine instances.
|
||||
from . import Preferences #To upgrade preferences.
|
||||
from . import Profile # To upgrade profiles.
|
||||
|
||||
## Converts configuration from Cura 2.1's file formats to Cura 2.2's.
|
||||
@ -35,13 +36,16 @@ class VersionUpgrade21to22(VersionUpgrade):
|
||||
return None
|
||||
return machine_instance.export()
|
||||
|
||||
## Converts preferences from format version 1 to version 2.
|
||||
## Converts preferences from format version 2 to version 3.
|
||||
#
|
||||
# \param serialised The serialised preferences file in version 1.
|
||||
# \return The serialised preferences in version 2, or None if the input
|
||||
# \param serialised The serialised preferences file in version 2.
|
||||
# \return The serialised preferences in version 3, or None if the input
|
||||
# was not of the correct format.
|
||||
def upgradePreferences(self, serialised):
|
||||
return serialised #TODO
|
||||
preferences = Preferences.importFrom(serialised)
|
||||
if not preferences: #Invalid file format.
|
||||
return None
|
||||
return preferences.export()
|
||||
|
||||
## Converts profiles from format version 1 to version 2.
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user