__init__.py 2.3 KB

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