def recheck(upload, session): # STU: I'm not sure, but I don't thin kthis is necessary any longer: upload.recheck(session) if len(upload.rejects) > 0: answer = "XXX" if Options["No-Action"] or Options["Automatic"] or Options["Trainee"]: answer = 'S' print "REJECT\n%s" % '\n'.join(upload.rejects) prompt = "[R]eject, Skip, Quit ?" while prompt.find(answer) == -1: answer = utils.our_raw_input(prompt) m = re_default_answer.match(prompt) if answer == "": answer = m.group(1) answer = answer[:1].upper() if answer == 'R': upload.do_reject(manual=0, reject_message='\n'.join(upload.rejects)) upload.pkg.remove_known_changes(session=session) session.commit() return 0 elif answer == 'S': return 0 elif answer == 'Q': end() sys.exit(0) return 1
def edit_index (new, upload, index): package = new[index]['package'] priority = new[index]["priority"] section = new[index]["section"] ftype = new[index]["type"] done = 0 while not done: print "\t".join([package, priority, section]) answer = "XXX" if ftype != "dsc": prompt = "[B]oth, Priority, Section, Done ? " else: prompt = "[S]ection, Done ? " edit_priority = edit_section = 0 while prompt.find(answer) == -1: answer = utils.our_raw_input(prompt) m = re_default_answer.match(prompt) if answer == "": answer = m.group(1) answer = answer[:1].upper() if answer == 'P': edit_priority = 1 elif answer == 'S': edit_section = 1 elif answer == 'B': edit_priority = edit_section = 1 elif answer == 'D': done = 1 # Edit the priority if edit_priority: readline.set_completer(Priorities.complete) got_priority = 0 while not got_priority: new_priority = utils.our_raw_input("New priority: ").strip() if new_priority not in Priorities.priorities: print "E: '%s' is not a valid priority, try again." % (new_priority) else: got_priority = 1 priority = new_priority # Edit the section if edit_section: readline.set_completer(Sections.complete) got_section = 0 while not got_section: new_section = utils.our_raw_input("New section: ").strip() if new_section not in Sections.sections: print "E: '%s' is not a valid section, try again." % (new_section) else: got_section = 1 section = new_section # Reset the readline completer readline.set_completer(None) new[index]["priority"] = priority new[index]["section"] = section if section.find('/') != -1: component = section.split('/', 1)[0] else: component = 'main' new[index]['component'] = component return new
def edit_index(new, upload, index): package = new[index]['package'] priority = new[index]["priority"] section = new[index]["section"] ftype = new[index]["type"] done = 0 while not done: print "\t".join([package, priority, section]) answer = "XXX" if ftype != "dsc": prompt = "[B]oth, Priority, Section, Done ? " else: prompt = "[S]ection, Done ? " edit_priority = edit_section = 0 while prompt.find(answer) == -1: answer = utils.our_raw_input(prompt) m = re_default_answer.match(prompt) if answer == "": answer = m.group(1) answer = answer[:1].upper() if answer == 'P': edit_priority = 1 elif answer == 'S': edit_section = 1 elif answer == 'B': edit_priority = edit_section = 1 elif answer == 'D': done = 1 # Edit the priority if edit_priority: readline.set_completer(Priorities.complete) got_priority = 0 while not got_priority: new_priority = utils.our_raw_input("New priority: ").strip() if new_priority not in Priorities.priorities: print "E: '%s' is not a valid priority, try again." % ( new_priority) else: got_priority = 1 priority = new_priority # Edit the section if edit_section: readline.set_completer(Sections.complete) got_section = 0 while not got_section: new_section = utils.our_raw_input("New section: ").strip() if new_section not in Sections.sections: print "E: '%s' is not a valid section, try again." % ( new_section) else: got_section = 1 section = new_section # Reset the readline completer readline.set_completer(None) new[index]["priority"] = priority new[index]["section"] = section if section.find('/') != -1: component = section.split('/', 1)[0] else: component = 'main' new[index]['component'] = component return new