__init__.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 VersionUpgrade25to26
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade25to26.VersionUpgrade25to26()
  8. def getMetaData() -> Dict[str, Any]:
  9. return {
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("preferences", 4000000): ("preferences", 4000001, upgrade.upgradePreferences),
  13. # NOTE: All the instance containers share the same general/version, so we have to update all of them
  14. # if any is updated.
  15. ("quality_changes", 2000000): ("quality_changes", 2000001, upgrade.upgradeInstanceContainer),
  16. ("user", 2000000): ("user", 2000001, upgrade.upgradeInstanceContainer),
  17. ("definition_changes", 2000000): ("definition_changes", 2000001, upgrade.upgradeInstanceContainer),
  18. ("machine_stack", 3000000): ("machine_stack", 3000001, upgrade.upgradeMachineStack),
  19. },
  20. "sources": {
  21. "quality_changes": {
  22. "get_version": upgrade.getCfgVersion,
  23. "location": {"./quality"}
  24. },
  25. "preferences": {
  26. "get_version": upgrade.getCfgVersion,
  27. "location": {"."}
  28. },
  29. "user": {
  30. "get_version": upgrade.getCfgVersion,
  31. "location": {"./user"}
  32. },
  33. "definition_changes": {
  34. "get_version": upgrade.getCfgVersion,
  35. "location": {"./machine_instances"}
  36. },
  37. "machine_stack": {
  38. "get_version": upgrade.getCfgVersion,
  39. "location": {"./machine_instances"}
  40. }
  41. }
  42. }
  43. def register(app: "Application") -> Dict[str, Any]:
  44. return { "version_upgrade": upgrade }