mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Fix stdout and stderr redirecting file location
This commit is contained in:
parent
20ffb0cd6d
commit
b70a89d0e1
1 changed files with 10 additions and 1 deletions
11
cura_app.py
11
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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue