__init__.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright (c) 2018 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import Any, Dict, TYPE_CHECKING
  4. from . import VersionUpgrade21to22
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade21to22.VersionUpgrade21to22()
  8. def getMetaData() -> Dict[str, Any]:
  9. return {
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("profile", 1000000): ("quality", 2000000, upgrade.upgradeProfile),
  13. ("machine_instance", 1000000): ("machine_stack", 2000000, upgrade.upgradeMachineInstance),
  14. ("preferences", 2000000): ("preferences", 3000000, upgrade.upgradePreferences)
  15. },
  16. "sources": {
  17. "profile": {
  18. "get_version": upgrade.getCfgVersion,
  19. "location": {"./profiles", "./instance_profiles"}
  20. },
  21. "machine_instance": {
  22. "get_version": upgrade.getCfgVersion,
  23. "location": {"./machine_instances"}
  24. },
  25. "preferences": {
  26. "get_version": upgrade.getCfgVersion,
  27. "location": {"."}
  28. },
  29. "user": {
  30. "get_version": upgrade.getCfgVersion,
  31. "location": {"./user"}
  32. }
  33. }
  34. }
  35. def register(app: "Application") -> Dict[str, Any]:
  36. return { "version_upgrade": upgrade }