__init__.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright (c) 2024 UltiMaker
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. from typing import Any, Dict, TYPE_CHECKING
  4. from . import VersionUpgrade58to59
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade58to59.VersionUpgrade58to59()
  8. def getMetaData() -> Dict[str, Any]:
  9. return {
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("preferences", 7000023): ("preferences", 7000024, upgrade.upgradePreferences),
  13. ("machine_stack", 6000023): ("machine_stack", 6000024, upgrade.upgradeStack),
  14. ("extruder_train", 6000023): ("extruder_train", 6000024, upgrade.upgradeStack),
  15. ("definition_changes", 4000023): ("definition_changes", 4000024, upgrade.upgradeInstanceContainer),
  16. ("quality_changes", 4000023): ("quality_changes", 4000024, upgrade.upgradeInstanceContainer),
  17. ("quality", 4000023): ("quality", 4000024, upgrade.upgradeInstanceContainer),
  18. ("user", 4000023): ("user", 4000024, upgrade.upgradeInstanceContainer),
  19. ("intent", 4000023): ("intent", 4000024, 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}