__init__.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright (c) 2023 UltiMaker
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import Any, Dict, TYPE_CHECKING
  4. from . import VersionUpgrade53to54
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade53to54.VersionUpgrade53to54()
  8. def getMetaData() -> Dict[str, Any]:
  9. return {
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("preferences", 7000021): ("preferences", 7000022, upgrade.upgradePreferences),
  13. ("machine_stack", 5000021): ("machine_stack", 5000022, upgrade.upgradeStack),
  14. ("extruder_train", 5000021): ("extruder_train", 5000022, upgrade.upgradeStack),
  15. ("definition_changes", 4000021): ("definition_changes", 4000022, upgrade.upgradeInstanceContainer),
  16. ("quality_changes", 4000021): ("quality_changes", 4000022, upgrade.upgradeInstanceContainer),
  17. ("quality", 4000021): ("quality", 4000022, upgrade.upgradeInstanceContainer),
  18. ("user", 4000021): ("user", 4000022, upgrade.upgradeInstanceContainer),
  19. ("intent", 4000021): ("intent", 4000022, upgrade.upgradeInstanceContainer),
  20. },
  21. "sources": {
  22. "preferences": {
  23. "get_version": upgrade.getCfgVersion,
  24. "location": {"."}
  25. },
  26. "machine_stack": {
  27. "get_version": upgrade.getCfgVersion,
  28. "location": {"./machine_instances"}
  29. },
  30. "extruder_train": {
  31. "get_version": upgrade.getCfgVersion,
  32. "location": {"./extruders"}
  33. },
  34. "definition_changes": {
  35. "get_version": upgrade.getCfgVersion,
  36. "location": {"./definition_changes"}
  37. },
  38. "quality_changes": {
  39. "get_version": upgrade.getCfgVersion,
  40. "location": {"./quality_changes"}
  41. },
  42. "quality": {
  43. "get_version": upgrade.getCfgVersion,
  44. "location": {"./quality"}
  45. },
  46. "user": {
  47. "get_version": upgrade.getCfgVersion,
  48. "location": {"./user"}
  49. }
  50. }
  51. }
  52. def register(app: "Application") -> Dict[str, Any]:
  53. return {"version_upgrade": upgrade}