def do_LOAD_ASSIGNEE(self): print '' print 'Getting assignee & cc list, please wait...' assignee, cc = packageInfo.getAssignedPersons(self.pkg_info) if self.data['component'] == 'Security': cc.append('*****@*****.**') if not self.interact: assignee = console.custom_input(msg='Assignee: ', preselect=assignee) cc = re.split( r',* *', console.custom_input(msg="CC (separated by ','): ", preselect=", ".join(cc))) self.data['assigned_to'] = assignee self.data['cc'] = cc return 'TEST_SUMMARY' print 'This/these address(es) were found:' print 'assignee: ' + assignee print 'cc: ', pprint.pprint(cc) yes = console.yes_no('Do you want to change the assignee? Yes/No') if yes: assignee = console.custom_input('New assignee: ', preselect=assignee) print 'Chose %s as assignee.' % assignee print '' if len(cc) > 0: yes = console.yes_no('Do you want to remove anybody from the cc list'\ ' (one at a time)? Yes/No') while yes: console.print_list(cc, msg='Available choices') idx = console.get_index(len(cc), msg='Which one?') del cc[idx] print '' yes = console.yes_no( 'Do you want to remove another person? Yes/No') print '' yes = console.yes_no('Do you want to add another cc(s)? Yes/No') if yes: print '' print 'Enter their e-mail addresses, one at a time.' print "To stop, enter something that does not contain '@'." ans = raw_input('Cc: ') while '@' in ans: cc.append(ans) ans = raw_input('Cc: ') print 'new cc list: ' pprint.pprint(cc) self.data['assigned_to'] = assignee self.data['cc'] = cc return 'TEST_SUMMARY'
def do_LOAD_ASSIGNEE(self): print '' print 'Getting assignee & cc list, please wait...' assignee, cc = packageInfo.getAssignedPersons(self.pkg_info) if self.data['component'] == 'Security': cc.append('*****@*****.**') if not self.interact: assignee = console.custom_input(msg='Assignee: ', preselect=assignee) cc = re.split(r',* *', console.custom_input(msg="CC (separated by ','): ", preselect=", ".join(cc))) self.data['assigned_to'] = assignee self.data['cc'] = cc return 'TEST_SUMMARY' print 'This/these address(es) were found:' print 'assignee: ' + assignee print 'cc: ', pprint.pprint(cc) yes = console.yes_no('Do you want to change the assignee? Yes/No') if yes: assignee = console.custom_input('New assignee: ', preselect=assignee) print 'Chose %s as assignee.' % assignee print '' if len(cc) > 0: yes = console.yes_no('Do you want to remove anybody from the cc list'\ ' (one at a time)? Yes/No') while yes: console.print_list(cc, msg='Available choices') idx = console.get_index(len(cc), msg='Which one?') del cc[idx] print '' yes = console.yes_no('Do you want to remove another person? Yes/No') print '' yes = console.yes_no('Do you want to add another cc(s)? Yes/No') if yes: print '' print 'Enter their e-mail addresses, one at a time.' print "To stop, enter something that does not contain '@'." ans = raw_input('Cc: ') while '@' in ans: cc.append(ans) ans = raw_input('Cc: ') print 'new cc list: ' pprint.pprint(cc) self.data['assigned_to'] = assignee self.data['cc'] = cc return 'TEST_SUMMARY'
def do_GET_PLATFORM(self): print '' aux1, platform, aux2 = gather_from_release() ans = console.custom_input(msg='Platform: ', preselect=platform) self.data['rep_platform'] = ans return 'TEST_PRODUCT_PLATFORM'
def do_PRE_ASK_PRODUCT_PLATFORM(self): print '' product, platform, full_name = gather_from_release() if not self.interact: self.data['product'] = console.custom_input(msg="Product (or '?' for a list): ", preselect=product).strip() if self.data['product'] == '?': return "SELECT_PRODUCT_PLATFORM" self.data['rep_platform'] = console.custom_input(msg="Platform: ", preselect=platform) return "TEST_PRODUCT_PLATFORM" print 'Found %s.' % full_name correct = console.yes_no('Is that the correct product & platform? yes/no') if correct: self.data['product'] = product self.data['rep_platform'] = platform return 'TEST_PRODUCT_PLATFORM' return 'ASK_PRODUCT_PLATFORM'
def do_PRE_ASK_PRODUCT_PLATFORM(self): print '' product, platform, full_name = gather_from_release() if not self.interact: self.data['product'] = console.custom_input( msg="Product (or '?' for a list): ", preselect=product).strip() if self.data['product'] == '?': return "SELECT_PRODUCT_PLATFORM" self.data['rep_platform'] = console.custom_input( msg="Platform: ", preselect=platform) return "TEST_PRODUCT_PLATFORM" print 'Found %s.' % full_name correct = console.yes_no( 'Is that the correct product & platform? yes/no') if correct: self.data['product'] = product self.data['rep_platform'] = platform return 'TEST_PRODUCT_PLATFORM' return 'ASK_PRODUCT_PLATFORM'