klippy: Move restart logic into Printer() class

Move the restart logic out of main() and into Printer.run().  This
simplifies the code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-08-26 13:20:16 -04:00
parent d8c75fc608
commit 0c2919b534
2 changed files with 17 additions and 28 deletions

View file

@ -114,7 +114,7 @@ class GCodeParser:
self.toolhead.force_shutdown()
self.respond_error('Internal error on command:"%s"' % (cmd,))
if self.is_fileinput:
self.printer.request_exit('exit_eof')
self.printer.request_exit()
break
self.ack()
self.need_ack = prev_need_ack
@ -141,7 +141,7 @@ class GCodeParser:
self.motor_heater_off()
if self.toolhead is not None:
self.toolhead.wait_moves()
self.printer.request_exit('exit_eof')
self.printer.request_exit()
self.is_processing_data = False
if self.fd_handle is None:
self.fd_handle = self.reactor.register_fd(self.fd, self.process_data)