diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2017-09-04 15:08:03 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2017-09-04 15:08:03 +0300 |
commit | b70a89d0e1c5f130d8538e05eb889e9fcc21ec8c (patch) | |
tree | 33c18d04c98251bd76569f99ceb0f8b05ad987e4 /cura_app.py | |
parent | 20ffb0cd6d77354f5882582f9fea07f7f3aeb2c4 (diff) |
Fix stdout and stderr redirecting file location
Diffstat (limited to 'cura_app.py')
-rwxr-xr-x | cura_app.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cura_app.py b/cura_app.py index 1d8867f1f4..2e406f99d3 100755 --- a/cura_app.py +++ b/cura_app.py @@ -54,8 +54,17 @@ import Arcus #@UnusedImport import cura.CuraApplication import cura.Settings.CuraContainerRegistry +def get_cura_dir_path(): + if Platform.isWindows(): + return os.path.expanduser("~/AppData/Local/cura/") + elif Platform.isLinux(): + return os.path.expanduser("~/.local/share/cura") + elif Platform.isOSX(): + return os.path.expanduser("~/Library/Application Support/cura") + + if hasattr(sys, "frozen"): - dirpath = os.path.expanduser("~/AppData/Local/cura/") + dirpath = get_cura_dir_path() os.makedirs(dirpath, exist_ok = True) sys.stdout = open(os.path.join(dirpath, "stdout.log"), "w") sys.stderr = open(os.path.join(dirpath, "stderr.log"), "w") |