ApplicationMetadata.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Copyright (c) 2020 Ultimaker B.V.
  2. # Cura is released under the terms of the LGPLv3 or higher.
  3. # ---------
  4. # General constants used in Cura
  5. # ---------
  6. DEFAULT_CURA_APP_NAME = "cura"
  7. DEFAULT_CURA_DISPLAY_NAME = "Ultimaker Cura"
  8. DEFAULT_CURA_VERSION = "master"
  9. DEFAULT_CURA_BUILD_TYPE = ""
  10. DEFAULT_CURA_DEBUG_MODE = False
  11. # Each release has a fixed SDK version coupled with it. It doesn't make sense to make it configurable because, for
  12. # example Cura 3.2 with SDK version 6.1 will not work. So the SDK version is hard-coded here and left out of the
  13. # CuraVersion.py.in template.
  14. CuraSDKVersion = "7.4.0"
  15. try:
  16. from cura.CuraVersion import CuraAppName # type: ignore
  17. if CuraAppName == "":
  18. CuraAppName = DEFAULT_CURA_APP_NAME
  19. except ImportError:
  20. CuraAppName = DEFAULT_CURA_APP_NAME
  21. try:
  22. from cura.CuraVersion import CuraVersion # type: ignore
  23. if CuraVersion == "":
  24. CuraVersion = DEFAULT_CURA_VERSION
  25. except ImportError:
  26. CuraVersion = DEFAULT_CURA_VERSION # [CodeStyle: Reflecting imported value]
  27. # CURA-6569
  28. # This string indicates what type of version it is. For example, "enterprise". By default it's empty which indicates
  29. # a default/normal Cura build.
  30. try:
  31. from cura.CuraVersion import CuraBuildType # type: ignore
  32. except ImportError:
  33. CuraBuildType = DEFAULT_CURA_BUILD_TYPE
  34. try:
  35. from cura.CuraVersion import CuraDebugMode # type: ignore
  36. except ImportError:
  37. CuraDebugMode = DEFAULT_CURA_DEBUG_MODE
  38. # CURA-6569
  39. # Various convenience flags indicating what kind of Cura build it is.
  40. __ENTERPRISE_VERSION_TYPE = "enterprise"
  41. IsEnterpriseVersion = CuraBuildType.lower() == __ENTERPRISE_VERSION_TYPE
  42. try:
  43. from cura.CuraVersion import CuraAppDisplayName # type: ignore
  44. if CuraAppDisplayName == "":
  45. CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME
  46. if IsEnterpriseVersion:
  47. CuraAppDisplayName = CuraAppDisplayName + " Enterprise"
  48. except ImportError:
  49. CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME