excuse.py: Use a set for storing bugs

Signed-off-by: Niels Thykier <niels@thykier.net>
debian
Niels Thykier 11 years ago
parent 87813401bf
commit 24db50994e

@ -57,8 +57,8 @@ class Excuse(object):
self.sane_deps = [] self.sane_deps = []
self.break_deps = [] self.break_deps = []
self.bugs = [] self.bugs = []
self.newbugs = {} self.newbugs = set()
self.oldbugs = {} self.oldbugs = set()
self.reason = {} self.reason = {}
self.htmlline = [] self.htmlline = []
@ -162,10 +162,8 @@ class Excuse(object):
def setbugs(self, oldbugs, newbugs): def setbugs(self, oldbugs, newbugs):
""""Set the list of old and new bugs""" """"Set the list of old and new bugs"""
for bug in newbugs: self.newbugs.update(newbugs)
self.newbugs[bug] = 1 self.oldbugs.update(oldbugs)
for bug in oldbugs:
self.oldbugs[bug] = 1
def addreason(self, reason): def addreason(self, reason):
""""adding reason""" """"adding reason"""
@ -222,8 +220,8 @@ class Excuse(object):
excusedata["newversion"] = self.ver[1] excusedata["newversion"] = self.ver[1]
excusedata["age"] = self.daysold excusedata["age"] = self.daysold
excusedata["ageneeded"] = self.mindays excusedata["ageneeded"] = self.mindays
excusedata["newbugs"] = self.newbugs.keys() excusedata["newbugs"] = sorted(self.newbugs)
excusedata["oldbugs"] = self.oldbugs.keys() excusedata["oldbugs"] = sorted(self.oldbugs)
if self.forced: if self.forced:
excusedata["forcedreason"] = self.reason.keys() excusedata["forcedreason"] = self.reason.keys()
excusedata["reason"] = [] excusedata["reason"] = []

Loading…
Cancel
Save