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

__init__.py « VersionUpgrade21to22 « VersionUpgrade « plugins - github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 67530b9d4531c81eb86c4ac15a79f511420f0f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.

from typing import Any, Dict, TYPE_CHECKING

from . import VersionUpgrade21to22

if TYPE_CHECKING:
    from UM.Application import Application

upgrade = VersionUpgrade21to22.VersionUpgrade21to22()

def getMetaData() -> Dict[str, Any]:
    return {
        "version_upgrade": {
            # From                         To                         Upgrade function
            ("profile", 1000000):          ("quality", 2000000,       upgrade.upgradeProfile),
            ("machine_instance", 1000000): ("machine_stack", 2000000, upgrade.upgradeMachineInstance),
            ("preferences", 2000000):      ("preferences", 3000000,   upgrade.upgradePreferences)
        },
        "sources": {
            "profile": {
                "get_version": upgrade.getCfgVersion,
                "location": {"./profiles", "./instance_profiles"}
            },
            "machine_instance": {
                "get_version": upgrade.getCfgVersion,
                "location": {"./machine_instances"}
            },
            "preferences": {
                "get_version": upgrade.getCfgVersion,
                "location": {"."}
            },
            "user": {
                "get_version": upgrade.getCfgVersion,
                "location": {"./user"}
            }
        }
    }

def register(app: "Application") -> Dict[str, Any]:
    return { "version_upgrade": upgrade }