ApplicationMetadata.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Copyright (c) 2022 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 = "8.0.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. IsAlternateVersion = CuraBuildType.lower() not in [DEFAULT_CURA_BUILD_TYPE, __ENTERPRISE_VERSION_TYPE]
  43. # NOTE: IsAlternateVersion is to make it possibile to have 'non-numbered' versions, at least as presented to the user.
  44. # (Internally, it'll still have some sort of version-number, but the user is never meant to see it in the GUI).
  45. # Warning: This will also change (some of) the icons/splash-screen to the 'work in progress' alternatives!
  46. try:
  47. from cura.CuraVersion import CuraAppDisplayName # type: ignore
  48. if CuraAppDisplayName == "":
  49. CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME
  50. if IsEnterpriseVersion:
  51. CuraAppDisplayName = CuraAppDisplayName + " Enterprise"
  52. except ImportError:
  53. CuraAppDisplayName = DEFAULT_CURA_DISPLAY_NAME