__init__.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 VersionUpgrade34to35
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade34to35.VersionUpgrade34to35()
  8. def getMetaData() -> Dict[str, Any]:
  9. return {
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("preferences", 6000000): ("preferences", 6000005, upgrade.upgradePreferences),
  13. ("preferences", 6000004): ("preferences", 6000005, upgrade.upgradePreferences),
  14. ("definition_changes", 4000004): ("definition_changes", 4000005, upgrade.upgradeInstanceContainer),
  15. ("quality_changes", 4000004): ("quality_changes", 4000005, upgrade.upgradeInstanceContainer),
  16. ("quality", 4000004): ("quality", 4000005, upgrade.upgradeInstanceContainer),
  17. ("user", 4000004): ("user", 4000005, upgrade.upgradeInstanceContainer),
  18. ("machine_stack", 4000004): ("machine_stack", 4000005, upgrade.upgradeStack),
  19. ("extruder_train", 4000004): ("extruder_train", 4000005, upgrade.upgradeStack),
  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 }