__init__.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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 VersionUpgrade
  5. if TYPE_CHECKING:
  6. from UM.Application import Application
  7. upgrade = VersionUpgrade.VersionUpgrade22to24()
  8. def getMetaData() -> Dict[str, Any]:
  9. return {
  10. "version_upgrade": {
  11. # From To Upgrade function
  12. ("machine_instance", 2000000): ("machine_stack", 3000000, upgrade.upgradeMachineInstance),
  13. ("extruder_train", 2000000): ("extruder_train", 3000000, upgrade.upgradeExtruderTrain),
  14. ("preferences", 3000000): ("preferences", 4000000, upgrade.upgradePreferences),
  15. ("quality", 2000000): ("quality_changes", 2000000, upgrade.upgradeQuality),
  16. },
  17. "sources": {
  18. "machine_stack": {
  19. "get_version": upgrade.getCfgVersion,
  20. "location": {"./machine_instances"}
  21. },
  22. "extruder_train": {
  23. "get_version": upgrade.getCfgVersion,
  24. "location": {"./extruders"}
  25. },
  26. }
  27. }
  28. def register(app: "Application"):
  29. return { "version_upgrade": upgrade }