@@ -242,6 +242,22 @@ def _ask_do_another(self, obj_type):
242242 self .bad_input ("Sorry, I didn't understand that." )
243243 return do_another
244244
245+ def _do_one (self , step , req ):
246+ try :
247+ obj = step .func (self )
248+ except RestartObjectException :
249+ self .say ("Okay, let's try that again." )
250+ return True
251+ self .register (obj , step .display_name , step .store_name )
252+ requires_another , allows_another = self ._req_do_another (req )
253+ if requires_another :
254+ do_another = True
255+ elif not requires_another and allows_another :
256+ do_another = self ._ask_do_another (step .display_name )
257+ else :
258+ do_another = False
259+ return do_another
260+
245261 def run_wizard (self ):
246262 self .start ("Hi! I'm the OpenPathSampling Wizard." )
247263 # TODO: next line is only temporary
@@ -251,20 +267,7 @@ def run_wizard(self):
251267 req = step .store_name , step .minimum , step .maximum
252268 do_another = True
253269 while do_another :
254- try :
255- obj = step .func (self )
256- except RestartObjectException :
257- self .say ("Okay, let's try that again." )
258- continue
259- self .register (obj , step .display_name , step .store_name )
260- requires_another , allows_another = self ._req_do_another (req )
261- if requires_another :
262- do_another = True
263- elif not requires_another and allows_another :
264- do_another = self ._ask_do_another (step .display_name )
265- else :
266- do_another = False
267-
270+ do_another = self ._do_one (step , req )
268271 storage = self .get_storage ()
269272 self .save_to_file (storage )
270273
0 commit comments