Subversion

helios_wp3

[/] [trunk/] [python/] [debbugsloc.py.old] - Rev 18

Compare with Previous - Blame


# Copyright Olivier Berger <olivier.berger@it-sudparis.eu> + Institut TELECOM, 2008
# developped in the frame of the HELIOS project (http://www.helios-platform.org/)
# License : GNU LGPL V3


# import these bits from btsutils (Debian package 'python-btsutils')
from btsutils.debbugs import debbugs
from bugloc import Bugloc

# Specialize debbugs to add a "local" bugtracker proxy which uses the
# BTS database mirror's spool as in bts-link
class debbugsloc(debbugs):

    # spool is an instance of bts-link's bts.BtsInterface
    def __init__(self, spool, fallback_soap=False):
        self.spool = spool
        self.fallback_soap = fallback_soap
        debbugs.__init__(self)

    def get(self, bugnumber):
#        try:
            bug = Bugloc()

            spoolbug = self.spool.getReport(bugnumber)

            if spoolbug:
#                print "processing from spool", bugnumber

                # all fine for Bug
                bug.setBug(spoolbug.id)
                bug.setPackage(spoolbug.package)
                
                bug.setSummary(spoolbug.subject)
                bug.setSeverity(spoolbug.severity)
                bug.setSubmitter(spoolbug.submitter)
                bug.setTags(spoolbug.tags)
                bug.setUserTags(spoolbug.usertags)
                #bug.setStatus(status)
                bug.setForwarded(spoolbug.forward)
                bug.setURL('http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s' % spoolbug.id)
                
                # only in Bugloc
                bug.setDate(spoolbug.date)

                return bug
            else:
#        except:
                if self.fallback_soap :
#                    print "processing from soap", bugnumber
                    return debbugs.get(self,bugnumber)
                else:
                    return None


Powered by WebSVN v1.61