
import sys

def exceptHook(type, value, traceback):
    import cura.CrashHandler
    cura.CrashHandler.show(type, value, traceback)

sys.excepthook = exceptHook

import cura.CuraApplication

if sys.platform == "win32" and hasattr(sys, "frozen"):
    from UM.Resources import Resources
    sys.stdout = open(Resources.getStoragePath(Resources.Resources, "stdout.log"), "w")
    sys.stderr = open(Resources.getStoragePath(Resources.Resources, "stderr.log"), "w")

app = cura.CuraApplication.CuraApplication.getInstance()
app.run()


import sys

def exceptHook(type, value, traceback):
    import cura.CrashHandler
    cura.CrashHandler.show(type, value, traceback)

sys.excepthook = exceptHook

import cura.CuraApplication

if sys.platform == "win32" and hasattr(sys, "frozen"):
    import os.path
    sys.stdout = open(os.path.expanduser("~/AppData/Local/cura/stdout.log"), "w")
    sys.stderr = open(os.path.expanduser("~/AppData/Local/cura/stderr.log"), "w")

app = cura.CuraApplication.CuraApplication.getInstance()
app.run()

Fix stdout/stderr output location so we do not output to UM but to cura
Fix stdout/stderr output location so we do not output to UM but to cura

Fixes #452

  
  import sys
  
  def exceptHook(type, value, traceback):
      import cura.CrashHandler
      cura.CrashHandler.show(type, value, traceback)
  
  sys.excepthook = exceptHook
  
  import cura.CuraApplication
  
  if sys.platform == "win32" and hasattr(sys, "frozen"):
-     from UM.Resources import Resources
-     sys.stdout = open(Resources.getStoragePath(Resources.Resources, "stdout.log"), "w")
-     sys.stderr = open(Resources.getStoragePath(Resources.Resources, "stderr.log"), "w")
+     import os.path
+     sys.stdout = open(os.path.expanduser("~/AppData/Local/cura/stdout.log"), "w")
+     sys.stderr = open(os.path.expanduser("~/AppData/Local/cura/stderr.log"), "w")
  
  app = cura.CuraApplication.CuraApplication.getInstance()
  app.run()
  
Fix stdout/stderr output location so we do not output to UM but to cura
## Code Before:

import sys

def exceptHook(type, value, traceback):
    import cura.CrashHandler
    cura.CrashHandler.show(type, value, traceback)

sys.excepthook = exceptHook

import cura.CuraApplication

if sys.platform == "win32" and hasattr(sys, "frozen"):
    from UM.Resources import Resources
    sys.stdout = open(Resources.getStoragePath(Resources.Resources, "stdout.log"), "w")
    sys.stderr = open(Resources.getStoragePath(Resources.Resources, "stderr.log"), "w")

app = cura.CuraApplication.CuraApplication.getInstance()
app.run()

## Instruction:
Fix stdout/stderr output location so we do not output to UM but to cura
## Code After:

import sys

def exceptHook(type, value, traceback):
    import cura.CrashHandler
    cura.CrashHandler.show(type, value, traceback)

sys.excepthook = exceptHook

import cura.CuraApplication

if sys.platform == "win32" and hasattr(sys, "frozen"):
    import os.path
    sys.stdout = open(os.path.expanduser("~/AppData/Local/cura/stdout.log"), "w")
    sys.stderr = open(os.path.expanduser("~/AppData/Local/cura/stderr.log"), "w")

app = cura.CuraApplication.CuraApplication.getInstance()
app.run()
