Commit 83bdc4e8 authored by Guillaume Seguin's avatar Guillaume Seguin

Cleanup exit behavior and stop eating all errors in pronsole

parent e0e0f8c4
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
import cmd, sys import cmd, sys
import glob, os, time, datetime import glob, os, time, datetime
import sys, subprocess import sys, subprocess, traceback
import math, codecs import math, codecs
import shlex import shlex
from math import sqrt from math import sqrt
...@@ -1210,7 +1210,6 @@ class pronsole(cmd.Cmd): ...@@ -1210,7 +1210,6 @@ class pronsole(cmd.Cmd):
print "Setting bed temp to 0" print "Setting bed temp to 0"
self.p.send_now("M140 S0.0") self.p.send_now("M140 S0.0")
self.log("Disconnecting from printer...") self.log("Disconnecting from printer...")
print self.p.printing
if self.p.printing: if self.p.printing:
print "Are you sure you want to exit while printing?" print "Are you sure you want to exit while printing?"
print "(this will terminate the print)." print "(this will terminate the print)."
...@@ -1434,6 +1433,9 @@ if __name__ == "__main__": ...@@ -1434,6 +1433,9 @@ if __name__ == "__main__":
interp.parse_cmdline(sys.argv[1:]) interp.parse_cmdline(sys.argv[1:])
try: try:
interp.cmdloop() interp.cmdloop()
except SystemExit:
interp.p.disconnect()
except: except:
print _("Caught an exception, exiting:")
traceback.print_exc()
interp.p.disconnect() interp.p.disconnect()
#raise
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment