From 8a44705413d3a01e897d4a922e7c1383b60a2927 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 23 Jun 2016 10:52:42 +0200 Subject: [PATCH] Update metadata with dynamic config types After settings rework, we decided to make the upgrade plug-ins define their own configuration types. This is basically the definition for these configuration types. Only the get_version function is not yet implemented. Contributes to issue CURA-844. --- .../VersionUpgrade21to22/__init__.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade21to22/__init__.py b/plugins/VersionUpgrade/VersionUpgrade21to22/__init__.py index 36b6d6609a..2607b92e6a 100644 --- a/plugins/VersionUpgrade/VersionUpgrade21to22/__init__.py +++ b/plugins/VersionUpgrade/VersionUpgrade21to22/__init__.py @@ -16,13 +16,23 @@ def getMetaData(): "api": 2 }, "version_upgrade": { + # From To Upgrade function + ("profile", 1): ("instance_container", 2, VersionUpgrade21to22.upgradeProfile), + ("machine_instance", 1): ("container_stack", 2, VersionUpgrade21to22.upgradeMachineInstance), + ("preferences", 1): ("preferences", 2, VersionUpgrade21to22.upgradePreferences) + }, + "sources": { "profile": { - "from": 1, - "to": 2 + "get_version": VersionUpgrade21to22.getCfgVersion, + "location": {"./profiles"} }, "machine_instance": { - "from": 1, - "to": 2 + "get_version": VersionUpgrade21to22.getCfgVersion, + "location": {"./machine_instances"} + }, + "preferences": { + "get_version": VersionUpgrade21to22.getCfgVersion, + "location": {"."} } } }