UltimakerCloudConstants.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright (c) 2018 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. # ---------
  4. # Constants used for the Cloud API
  5. # ---------
  6. DEFAULT_CLOUD_API_ROOT = "https://api.ultimaker.com" # type: str
  7. DEFAULT_CLOUD_API_VERSION = "1" # type: str
  8. DEFAULT_CLOUD_ACCOUNT_API_ROOT = "https://account.ultimaker.com" # type: str
  9. DEFAULT_DIGITAL_FACTORY_URL = "https://digitalfactory.ultimaker.com" # type: str
  10. # Container Metadata keys
  11. META_UM_LINKED_TO_ACCOUNT = "um_linked_to_account"
  12. """(bool) Whether a cloud printer is linked to an Ultimaker account"""
  13. META_CAPABILITIES = "capabilities"
  14. """(list[str]) a list of capabilities this printer supports"""
  15. try:
  16. from cura.CuraVersion import CuraCloudAPIRoot # type: ignore
  17. if CuraCloudAPIRoot == "":
  18. CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT
  19. except ImportError:
  20. CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT
  21. try:
  22. from cura.CuraVersion import CuraCloudAPIVersion # type: ignore
  23. if CuraCloudAPIVersion == "":
  24. CuraCloudAPIVersion = DEFAULT_CLOUD_API_VERSION
  25. except ImportError:
  26. CuraCloudAPIVersion = DEFAULT_CLOUD_API_VERSION
  27. try:
  28. from cura.CuraVersion import CuraCloudAccountAPIRoot # type: ignore
  29. if CuraCloudAccountAPIRoot == "":
  30. CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT
  31. except ImportError:
  32. CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT
  33. try:
  34. from cura.CuraVersion import CuraDigitalFactoryURL # type: ignore
  35. if CuraDigitalFactoryURL == "":
  36. CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL
  37. except ImportError:
  38. CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL