__init__.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright (c) 2016 Ultimaker B.V.
  2. # Cura is released under the terms of the AGPLv3 or higher.
  3. from . import VersionUpgrade21to22
  4. from UM.i18n import i18nCatalog
  5. catalog = i18nCatalog("cura")
  6. upgrade = VersionUpgrade21to22.VersionUpgrade21to22()
  7. def getMetaData():
  8. return {
  9. "plugin": {
  10. "name": catalog.i18nc("@label", "Version Upgrade 2.1 to 2.2"),
  11. "author": "Ultimaker",
  12. "version": "1.0",
  13. "description": catalog.i18nc("@info:whatsthis", "Upgrades configurations from Cura 2.1 to Cura 2.2."),
  14. "api": 3
  15. },
  16. "version_upgrade": {
  17. # From To Upgrade function
  18. ("profile", 1): ("quality", 2, upgrade.upgradeProfile),
  19. ("machine_instance", 1): ("machine_stack", 2, upgrade.upgradeMachineInstance),
  20. ("preferences", 2): ("preferences", 3, upgrade.upgradePreferences)
  21. },
  22. "sources": {
  23. "profile": {
  24. "get_version": upgrade.getCfgVersion,
  25. "location": {"./profiles", "./instance_profiles"}
  26. },
  27. "machine_instance": {
  28. "get_version": upgrade.getCfgVersion,
  29. "location": {"./machine_instances"}
  30. },
  31. "preferences": {
  32. "get_version": upgrade.getCfgVersion,
  33. "location": {"."}
  34. }
  35. }
  36. }
  37. def register(app):
  38. return { "version_upgrade": upgrade }