HTMLParser.__init__(self)
self.state = self.STATE_NONE
self.bugs = []
+ self.bug = None
def handle_starttag(self, tag, attr):
if self.state == self.STATE_NONE and tag.lower() == "tr":
- if len(attr) == 1 and attr[0] == ('class', 'bz_normal bz_P2 '):
+ if len(attr) == 1 and attr[0][0] == 'class' and \
+ ('bz_normal' in attr[0][1] or 'bz_blocker' in attr[0][1] or 'bz_enhancement' in attr[0][1] or 'bz_major' in attr[0][1] or 'bz_minor' in attr[0][1] or 'bz_trivial' in attr[0][1] or 'bz_critical' in attr[0][1] or 'bz_wishlist' in attr[0][1]) \
+ and 'bz_P' in attr[0][1]:
self.state = self.STATE_FOUND_TR
elif self.state == self.STATE_FOUND_TR and tag.lower() == "td":
self.state += 1
if self.state != self.STATE_NONE:
self.bugs.append( (self.bug,self.status) )
self.state = self.STATE_NONE
+ self.bug = None
if self.state > 1 and tag.lower() == "td":
self.state += 1
return
if self.state == self.STATE_FOUND_NUMBER:
- self.bug = data
+ """
+ #1995 in bugs.oe.org has [SEC] additionally to the number and we want to ignore it
+ """
+ if not self.bug:
+ self.bug = data
elif self.state == self.STATE_FOUND_STATUS:
self.status = data