mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-03 10:44:18 +08:00
Fix stdout and stderr redirecting file location
This commit is contained in:
parent
20ffb0cd6d
commit
b70a89d0e1
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…
x
Reference in New Issue
Block a user