Make Cura app name configurable in CuraVersion

This commit is contained in:
fieldOfView 2018-11-13 16:08:29 +01:00
parent 7a577489ae
commit e66875865f
4 changed files with 13 additions and 5 deletions

View file

@ -26,13 +26,18 @@ parser.add_argument("--trigger-early-crash",
known_args = vars(parser.parse_known_args()[0])
if not known_args["debug"]:
try:
from cura.CuraVersion import CuraAppName # type: ignore
except ImportError:
CuraAppName = "cura"
def get_cura_dir_path():
if Platform.isWindows():
return os.path.expanduser("~/AppData/Roaming/cura")
return os.path.expanduser("~/AppData/Roaming/" + CuraAppName)
elif Platform.isLinux():
return os.path.expanduser("~/.local/share/cura")
return os.path.expanduser("~/.local/share/" + CuraAppName)
elif Platform.isOSX():
return os.path.expanduser("~/Library/Logs/cura")
return os.path.expanduser("~/Library/Logs/" + CuraAppName)
if hasattr(sys, "frozen"):
dirpath = get_cura_dir_path()