UltimakerCloudConstants.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. try:
  14. from cura.CuraVersion import CuraCloudAPIRoot # type: ignore
  15. if CuraCloudAPIRoot == "":
  16. CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT
  17. except ImportError:
  18. CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT
  19. try:
  20. from cura.CuraVersion import CuraCloudAPIVersion # type: ignore
  21. if CuraCloudAPIVersion == "":
  22. CuraCloudAPIVersion = DEFAULT_CLOUD_API_VERSION
  23. except ImportError:
  24. CuraCloudAPIVersion = DEFAULT_CLOUD_API_VERSION
  25. try:
  26. from cura.CuraVersion import CuraCloudAccountAPIRoot # type: ignore
  27. if CuraCloudAccountAPIRoot == "":
  28. CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT
  29. except ImportError:
  30. CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT
  31. try:
  32. from cura.CuraVersion import CuraDigitalFactoryURL # type: ignore
  33. if CuraDigitalFactoryURL == "":
  34. CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL
  35. except ImportError:
  36. CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL