예제 #1
0
 def __init__(self, package, subject='', body='', system='debian',
              incfiles='', sysinfo=True,
              followup=False, type='debbugs', mode=utils.MODE_STANDARD,
              debsumsoutput=None, issource=False, **props):
     self.type = type
     for (k, v) in props.iteritems():
         setattr(self, k, v)
     self.package = package
     self.subject = subject
     # try to convert followup to int (if it's not already), TypeError if
     # the conversion is impossible
     if followup and not isinstance(followup, int):
         try:
             self.followup = followup.bug_num
         except:
             ui.long_message('Invalid value for followup, it must be a debianbts.Bugreport instance or an integer')
             raise TypeError
     else:
         self.followup = followup
     self.body = body
     self.mode = mode
     self.system = system
     self.incfiles = incfiles
     self.sysinfo = sysinfo
     self.debsumsoutput = debsumsoutput
     self.issource = issource
예제 #2
0
 def tset(self, value):
     if value not in ('debbugs', 'launchpad'):
         ui.long_message('invalid report type %s, defaulting to debbugs' %
                         value)
         self.__type = 'debbugs'
     else:
         self.__type = value
예제 #3
0
            ewrite("Copies sent to:\n")
            for address in addrs:
                ewrite('  %s\n', address)

        if debbugs_cc and rtype == 'debbugs':
            ewrite("Copies will be sent after processing to:\n")
            for address in cclist:
                ewrite('  %s\n', address)

    if not (exinfo or kudos) and rtype == 'debbugs' and sysinfo and not failed \
           and '%s' in sysinfo['email']:
        ewrite('\n')
        ui.long_message(
            """If you want to provide additional information, please wait to
receive the bug tracking number via email; you may then send any extra
information to %s (e.g. %s), where n is the bug number.  Normally you
will receive an acknowledgement via email including the bug report number
within an hour; if you haven't received a confirmation, then the bug reporting process failed at some point (reportbug or MTA failure, BTS maintenance, etc.).\n""",
            (sysinfo['email'] % 'n'), (sysinfo['email'] % '999999'))

    # If we've stored more than one copy of the message, delete the
    # one without the SMTP headers.
    if filename and os.path.exists(msgname) and os.path.exists(filename):
        try:
            os.unlink(filename)
        except:
            pass

    if filename and os.path.exists(filename) and not mua:
        # Message is misleading if an MUA is used.
        ewrite("A copy of the report is stored as: %s\n" % filename)
예제 #4
0
        try:
            pipe.write(message)
            pipe.flush()
            if msgname:
                ewrite("Bug report written as %s\n", msgname)
        except IOError:
            failed = True
            pipe.close()

        if failed or (pipe.close() and using_sendmail):
            failed = True
            fh, msgname = TempFile(prefix=tfprefix, dir=draftpath)
            fh.write(message)
            fh.close()
            ui.long_message(
                'Error: send/write operation failed, bug report '
                'saved to %s\n', msgname)

    if mua:
        ewrite("Spawning %s...\n", mua.name)
        returnvalue = 0
        succeeded = False
        while not succeeded:
            returnvalue = mua.send(filename)
            if returnvalue != 0:
                ewrite(
                    "Mutt users should be aware it is mandatory to edit the draft before sending.\n"
                )
                mtitle = 'Report has not been sent yet; what do you want to do now?'
                mopts = 'Eq'
                moptsdesc = {