__init__.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright (c) 2021 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 VersionUpgrade411to412
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade411to412.VersionUpgrade411to412()
  8. def getMetaData() -> Dict[str, Any]:
  9. return {
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("machine_stack", 5000017): ("machine_stack", 5000019, upgrade.upgradeStack),
  13. ("extruder_train", 5000017): ("extruder_train", 5000019, upgrade.upgradeStack),
  14. ("definition_changes", 4000017): ("definition_changes", 4000019, upgrade.upgradeInstanceContainer),
  15. ("quality_changes", 4000017): ("quality_changes", 4000019, upgrade.upgradeInstanceContainer),
  16. ("quality", 4000017): ("quality", 4000019, upgrade.upgradeInstanceContainer),
  17. ("user", 4000017): ("user", 4000019, upgrade.upgradeInstanceContainer),
  18. ("preferences", 7000017): ("preferences", 7000019, upgrade.upgradePreferences),
  19. },
  20. "sources": {
  21. "machine_stack": {
  22. "get_version": upgrade.getCfgVersion,
  23. "location": {"./machine_instances"}
  24. },
  25. "extruder_train": {
  26. "get_version": upgrade.getCfgVersion,
  27. "location": {"./extruders"}
  28. },
  29. "definition_changes": {
  30. "get_version": upgrade.getCfgVersion,
  31. "location": {"./definition_changes"}
  32. },
  33. "quality_changes": {
  34. "get_version": upgrade.getCfgVersion,
  35. "location": {"./quality_changes"}
  36. },
  37. "quality": {
  38. "get_version": upgrade.getCfgVersion,
  39. "location": {"./quality"}
  40. },
  41. "user": {
  42. "get_version": upgrade.getCfgVersion,
  43. "location": {"./user"}
  44. }
  45. }
  46. }
  47. def register(app: "Application") -> Dict[str, Any]:
  48. return {"version_upgrade": upgrade}