Commit 02a34666 authored by Guillaume Seguin's avatar Guillaume Seguin

Nest print thread into a try block

parent 2cc0df4f
...@@ -405,21 +405,26 @@ class printcore(): ...@@ -405,21 +405,26 @@ class printcore():
def _print(self, resuming = False): def _print(self, resuming = False):
self._stop_sender() self._stop_sender()
if self.startcb: try:
#callback for printing started if self.startcb:
try: self.startcb(resuming) #callback for printing started
except: pass try: self.startcb(resuming)
while self.printing and self.printer and self.online: except: pass
self._sendnext() while self.printing and self.printer and self.online:
self.sentlines = {} self._sendnext()
self.log.clear() self.sentlines = {}
self.sent = [] self.log.clear()
if self.endcb: self.sent = []
#callback for printing done if self.endcb:
try: self.endcb() #callback for printing done
except: pass try: self.endcb()
self.print_thread = None except: pass
self._start_sender() except:
print "Print thread died due to the following error:"
traceback.print_exc()
finally:
self.print_thread = None
self._start_sender()
#now only "pause" is implemented as host command #now only "pause" is implemented as host command
def processHostCommand(self, command): def processHostCommand(self, command):
......
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