__init__.py 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright (c) 2020 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 VersionUpgrade45to46
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade45to46.VersionUpgrade45to46()
  8. def getMetaData() -> Dict[str, Any]:
  9. return {
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("preferences", 6000011): ("preferences", 6000013, upgrade.upgradePreferences),
  13. ("machine_stack", 4000011): ("machine_stack", 4000013, upgrade.upgradeStack),
  14. ("extruder_train", 4000011): ("extruder_train", 4000013, upgrade.upgradeStack),
  15. ("definition_changes", 4000011): ("definition_changes", 4000013, upgrade.upgradeInstanceContainer),
  16. ("quality_changes", 4000011): ("quality_changes", 4000013, upgrade.upgradeInstanceContainer),
  17. ("quality", 4000011): ("quality", 4000013, upgrade.upgradeInstanceContainer),
  18. ("user", 4000011): ("user", 4000013, upgrade.upgradeInstanceContainer),
  19. # Setting version 12 was also used during the 4.6 beta, but had no changes.
  20. ("preferences", 6000012): ("preferences", 6000013, upgrade.upgradePreferences),
  21. ("machine_stack", 4000012): ("machine_stack", 4000013, upgrade.upgradeStack),
  22. ("extruder_train", 4000012): ("extruder_train", 4000013, upgrade.upgradeStack),
  23. ("definition_changes", 4000012): ("definition_changes", 4000013, upgrade.upgradeInstanceContainer),
  24. ("quality_changes", 4000012): ("quality_changes", 4000013, upgrade.upgradeInstanceContainer),
  25. ("quality", 4000012): ("quality", 4000013, upgrade.upgradeInstanceContainer),
  26. ("user", 4000012): ("user", 4000013, upgrade.upgradeInstanceContainer),
  27. },
  28. "sources": {
  29. "preferences": {
  30. "get_version": upgrade.getCfgVersion,
  31. "location": {"."}
  32. },
  33. "machine_stack": {
  34. "get_version": upgrade.getCfgVersion,
  35. "location": {"./machine_instances"}
  36. },
  37. "extruder_train": {
  38. "get_version": upgrade.getCfgVersion,
  39. "location": {"./extruders"}
  40. },
  41. "definition_changes": {
  42. "get_version": upgrade.getCfgVersion,
  43. "location": {"./definition_changes"}
  44. },
  45. "quality_changes": {
  46. "get_version": upgrade.getCfgVersion,
  47. "location": {"./quality_changes"}
  48. },
  49. "quality": {
  50. "get_version": upgrade.getCfgVersion,
  51. "location": {"./quality"}
  52. },
  53. "user": {
  54. "get_version": upgrade.getCfgVersion,
  55. "location": {"./user"}
  56. }
  57. }
  58. }
  59. def register(app: "Application") -> Dict[str, Any]:
  60. return {"version_upgrade": upgrade}