def capture_box(cam, boxnum): while True: #retry loop retry = False captures = scan_card.watch_for_card(cam) scan_card.save_captures(boxnum, captures) print "captured %d cards. is this correct?" % len(captures) answer = raw_input() print "got answer: ", answer if re.search('[yc]',answer): break #finish the function else: print "try editing captures_%02d to match" % boxnum answer = "" while not re.match('[cra]', answer): print "when done - (c)orrected? (r)etry scan? or (a)bort?" answer = raw_input() if re.search('c',answer): break elif re.search('r',answer): continue elif re.search('a',answer): return #abort the scan #default will retry scan_card.folder_to_db(boxnum)
def capture_box(cam, boxnum): print "scanning %s" % boxnum while True: # retry loop retry = False captures = scan_card.watch_for_card(cam) print "captured %d cards. is this correct?" % len(captures) answer = raw_input() print "got answer: ", answer if re.search('[yc]', answer): break # finish the function else: while not re.match('[ra]', answer): print "(r)etry scan? or (a)bort?" answer = raw_input() if re.search('r', answer): continue elif re.search('a', answer): return # abort the scan # default will retry captures_to_db(captures, boxnum)
def capture_box(cam, boxnum): print "scanning %s" % boxnum while True: #retry loop retry = False captures = scan_card.watch_for_card(cam) print "captured %d cards. is this correct?" % len(captures) answer = raw_input() print "got answer: ", answer if re.search('[yc]', answer): break #finish the function else: while not re.match('[ra]', answer): print "(r)etry scan? or (a)bort?" answer = raw_input() if re.search('r', answer): continue elif re.search('a', answer): return #abort the scan #default will retry captures_to_db(captures, boxnum)