aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-09-12 19:11:20 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-09-12 21:06:54 -0400
commitd1da6100a6ce3cf832397953a852b2027b648b25 (patch)
tree1c8029e83b6dbbffdbd959ae6859739a1eaac4e6 /klippy
parent32b763efb17c44a9b359534477a772d469df96af (diff)
downloadkutter-d1da6100a6ce3cf832397953a852b2027b648b25.tar.gz
kutter-d1da6100a6ce3cf832397953a852b2027b648b25.tar.xz
kutter-d1da6100a6ce3cf832397953a852b2027b648b25.zip
klippy: Remove unneeded loop in run() method
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r--klippy/klippy.py35
1 files changed, 17 insertions, 18 deletions
diff --git a/klippy/klippy.py b/klippy/klippy.py
index f0935587..9427036a 100644
--- a/klippy/klippy.py
+++ b/klippy/klippy.py
@@ -260,24 +260,23 @@ class Printer:
monotime = self.reactor.monotonic()
logging.info("Start printer at %s (%.1f %.1f)",
time.asctime(time.localtime(systime)), systime, monotime)
- while 1:
- # Enter main reactor loop
- try:
- self.reactor.run()
- except:
- logging.exception("Unhandled exception during run")
- return "error_exit"
- # Check restart flags
- run_result = self.run_result
- try:
- if run_result == 'firmware_restart':
- for n, m in self.lookup_objects(module='mcu'):
- m.microcontroller_restart()
- for cb in self.state_cb:
- cb('disconnect')
- except:
- logging.exception("Unhandled exception during post run")
- return run_result
+ # Enter main reactor loop
+ try:
+ self.reactor.run()
+ except:
+ logging.exception("Unhandled exception during run")
+ return "error_exit"
+ # Check restart flags
+ run_result = self.run_result
+ try:
+ if run_result == 'firmware_restart':
+ for n, m in self.lookup_objects(module='mcu'):
+ m.microcontroller_restart()
+ for cb in self.state_cb:
+ cb('disconnect')
+ except:
+ logging.exception("Unhandled exception during post run")
+ return run_result
def invoke_shutdown(self, msg):
if self.is_shutdown:
return