__init__.py 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 VersionUpgrade49to50
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade49to50.VersionUpgrade49to50()
  8. def getMetaData() -> Dict[str, Any]:
  9. return { # Since there is no VersionUpgrade from 48 to 49 yet, upgrade the 48 profiles to 50.
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("preferences", 6000016): ("preferences", 6000018, upgrade.upgradePreferences),
  13. ("machine_stack", 5000016): ("machine_stack", 5000018, upgrade.upgradeStack),
  14. ("extruder_train", 5000016): ("extruder_train", 5000018, upgrade.upgradeStack),
  15. ("machine_stack", 4000018): ("machine_stack", 5000018, upgrade.upgradeStack), # We made a mistake in the arachne beta 1
  16. ("extruder_train", 4000018): ("extruder_train", 5000018, upgrade.upgradeStack), # We made a mistake in the arachne beta 1
  17. ("definition_changes", 4000016): ("definition_changes", 4000018, upgrade.upgradeInstanceContainer),
  18. ("quality_changes", 4000016): ("quality_changes", 4000018, upgrade.upgradeInstanceContainer),
  19. ("quality", 4000016): ("quality", 4000018, upgrade.upgradeInstanceContainer),
  20. ("user", 4000016): ("user", 4000018, upgrade.upgradeInstanceContainer),
  21. },
  22. "sources": {
  23. "preferences": {
  24. "get_version": upgrade.getCfgVersion,
  25. "location": {"."}
  26. },
  27. "machine_stack": {
  28. "get_version": upgrade.getCfgVersion,
  29. "location": {"./machine_instances"}
  30. },
  31. "extruder_train": {
  32. "get_version": upgrade.getCfgVersion,
  33. "location": {"./extruders"}
  34. },
  35. "definition_changes": {
  36. "get_version": upgrade.getCfgVersion,
  37. "location": {"./definition_changes"}
  38. },
  39. "quality_changes": {
  40. "get_version": upgrade.getCfgVersion,
  41. "location": {"./quality_changes"}
  42. },
  43. "quality": {
  44. "get_version": upgrade.getCfgVersion,
  45. "location": {"./quality"}
  46. },
  47. "user": {
  48. "get_version": upgrade.getCfgVersion,
  49. "location": {"./user"}
  50. }
  51. }
  52. }
  53. def register(app: "Application") -> Dict[str, Any]:
  54. return {"version_upgrade": upgrade}