__init__.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 VersionUpgrade30to31
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade30to31.VersionUpgrade30to31()
  8. def getMetaData() -> Dict[str, Any]:
  9. return {
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("preferences", 5000003): ("preferences", 5000004, upgrade.upgradePreferences),
  13. ("machine_stack", 3000003): ("machine_stack", 3000004, upgrade.upgradeStack),
  14. ("extruder_train", 3000003): ("extruder_train", 3000004, upgrade.upgradeStack),
  15. ("quality_changes", 2000003): ("quality_changes", 2000004, upgrade.upgradeInstanceContainer),
  16. ("user", 2000003): ("user", 2000004, upgrade.upgradeInstanceContainer),
  17. ("definition_changes", 2000003): ("definition_changes", 2000004, upgrade.upgradeInstanceContainer),
  18. ("variant", 2000003): ("variant", 2000004, upgrade.upgradeInstanceContainer)
  19. },
  20. "sources": {
  21. "preferences": {
  22. "get_version": upgrade.getCfgVersion,
  23. "location": {"."}
  24. },
  25. "machine_stack": {
  26. "get_version": upgrade.getCfgVersion,
  27. "location": {"./machine_instances"}
  28. },
  29. "extruder_train": {
  30. "get_version": upgrade.getCfgVersion,
  31. "location": {"./extruders"}
  32. },
  33. "quality": {
  34. "get_version": upgrade.getCfgVersion,
  35. "location": {"./quality"}
  36. },
  37. "quality_changes": {
  38. "get_version": upgrade.getCfgVersion,
  39. "location": {"./quality"}
  40. },
  41. "user": {
  42. "get_version": upgrade.getCfgVersion,
  43. "location": {"./user"}
  44. },
  45. "definition_changes": {
  46. "get_version": upgrade.getCfgVersion,
  47. "location": {"./definition_changes"}
  48. },
  49. "variant": {
  50. "get_version": upgrade.getCfgVersion,
  51. "location": {"./variants"}
  52. }
  53. }
  54. }
  55. def register(app: "Application") -> Dict[str, Any]:
  56. return { "version_upgrade": upgrade }