cura_app.py 677 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python3
  2. # Copyright (c) 2015 Ultimaker B.V.
  3. # Cura is released under the terms of the AGPLv3 or higher.
  4. import sys
  5. def exceptHook(type, value, traceback):
  6. import cura.CrashHandler
  7. cura.CrashHandler.show(type, value, traceback)
  8. sys.excepthook = exceptHook
  9. import cura.CuraApplication
  10. if sys.platform == "win32" and hasattr(sys, "frozen"):
  11. import os
  12. dirpath = os.path.expanduser("~/AppData/Local/cura/")
  13. os.makedirs(dirpath, exist_ok = True)
  14. sys.stdout = open(os.path.join(dirpath, "stdout.log"), "w")
  15. sys.stderr = open(os.path.join(dirpath, "stderr.log"), "w")
  16. app = cura.CuraApplication.CuraApplication.getInstance()
  17. app.run()