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_DESCRIPTION(self): print '' self.data['description'] = self.getHeader() + '\n\n' + console.edit_message(self.getHeader()) yes = console.yes_no('Do you want to add an automatically gathered'\ ' system description? Yes/No') if yes: self.data['description'] += '\n\n' + self.getSysData() + '\n' return 'ASK_SUBMIT'
def do_GET_DESCRIPTION(self): print '' self.data['description'] = self.getHeader( ) + '\n\n' + console.edit_message(self.getHeader()) yes = console.yes_no('Do you want to add an automatically gathered'\ ' system description? Yes/No') if yes: self.data['description'] += '\n\n' + self.getSysData() + '\n' return 'ASK_SUBMIT'
def do_ASK_SUBMIT(self): print '--------------------------------------------------------------' print '' print self.data['description'] print '--------------------------------------------------------------' print '' yes = console.yes_no('Do you want to submit this report? Yes/No') if yes: print '' print 'Please wait, checking validity of product and component.' return 'CHECK' yes = console.yes_no('Bug will not be reported. Do you want to save the report? Yes/No') if yes: try: file_name = self.save() print 'Report was saved into %s.' % file_name except OSError, oe: print oe.args[0]
def do_ASK_SUBMIT(self): print '--------------------------------------------------------------' print '' print self.data['description'] print '--------------------------------------------------------------' print '' yes = console.yes_no('Do you want to submit this report? Yes/No') if yes: print '' print 'Please wait, checking validity of product and component.' return 'CHECK' yes = console.yes_no( 'Bug will not be reported. Do you want to save the report? Yes/No') if yes: try: file_name = self.save() print 'Report was saved into %s.' % file_name except OSError, oe: print oe.args[0]
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'