Recover from exceptions
Allows restarting after an exception occurs
@@ -296,6 +296,7 @@ class FieldSequenceModel(object):
def run_step(self, framerate=None, allow_recording=True):
self.current_action = 'Running'
starttime = time.time()
+ try:
self.progress()
if allow_recording and self.steps % self.sequence_stride == 0:
self.record_frame()
@@ -305,6 +306,7 @@ class FieldSequenceModel(object):
if rest > 0:
self.current_action = 'Waiting'
time.sleep(rest)
+ finally:
self.current_action = None
def play(self, max_steps=None, callback=None, framerate=None, allow_recording=True, callback_if_aborted=False):
