UltimakerCloudAuthentication.py 974 B

12345678910111213141516171819202122232425262728
  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. try:
  10. from cura.CuraVersion import CuraCloudAPIRoot # type: ignore
  11. if CuraCloudAPIRoot == "":
  12. CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT
  13. except ImportError:
  14. CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT
  15. try:
  16. from cura.CuraVersion import CuraCloudAPIVersion # type: ignore
  17. except ImportError:
  18. CuraCloudAPIVersion = DEFAULT_CLOUD_API_VERSION
  19. try:
  20. from cura.CuraVersion import CuraCloudAccountAPIRoot # type: ignore
  21. if CuraCloudAccountAPIRoot == "":
  22. CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT
  23. except ImportError:
  24. CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT