[Reportbug-maint] Bug#508812: Reusing python-btsutils for bts-link
Bastian Venthur
venthur at debian.org
Wed Dec 17 12:22:28 UTC 2008
Hi,
just a quick question. Are the debianbts-python bindings supposed to go
into an extra package, will we reuse python-debianbts or is it supposed
to go into python-debian? Depending on the answer we can open or use the
appropriate mailinglist.
Anyways to make a start the discussion, here's what debianbts uses as
datastructure for a single bugreport. It fits the needs of reportbug-ng
so far, but maybe not others. Feel free to discuss:
class Bugreport(object):
"""Represents a bugreport from Debian's Bug Tracking System."""
def __init__(self, nr):
self.nr = unicode(nr)
self.summary = None
self.submitter = None
self.status = None
self.severity = None
self.fulltext = None
self.package = None
self.firstaction = None
self.lastaction = None
self.tags = None
def __str__(self):
s = "Bug: %s\n" % self.nr
s += "Package: %s\n" % self.package
s += "Summary: %s\n" % self.summary
s += "Submitter: %s\n" % self.submitter
s += "Status: %s\n" % self.status
s += "Severity: %s\n" % self.severity
s += "Tags: %s\n" % self.tags
s += "Firstaction: %s\n" % self.firstaction
s += "Lastaction: %s\n" % self.lastaction
s += "Fulltext: %s\n" % self.fulltext
return s
def value(self):
"""Returns an 'urgency value', the higher the number, the more
urgent
the bug is. Open bugs generally have higher urgencies than
closed ones.
"""
return STATUS_VALUE.get(self.status.lower(), 200) +
SEVERITY_VALUE.get(self.severity.lower(), 20)
nr: is the bugnumber
summary: is the subject line of the bugreport
submitter: is the submitter of the bugreport
status: is the bugstatus
severity: ...
fulltext: should hold the full bugreport but rng just displays the html
of our bts instead
package: is the package
first and lastaction: are dates
tags: ...
the "value" method helps to numerically sort bugreports, where open
bugreports have a higher value as closed ones and packages with a higher
severity have a higher number than bugreports with a lower one. One
could improve that by introducing a __comp__ method.
Cheers,
Bastian
--
Bastian Venthur http://venthur.de
Debian Developer venthur at debian org
More information about the Reportbug-maint
mailing list