class Bug: def __init__(self, base, nb): self.bug = Bugz(base).get(nb) if self.bug is None: raise Exception('Failed to create bug') def _get_detail(self, detail): tmp = self.bug.find('//%s' % detail) if tmp is None: return None return tmp.text def get_title(self): return self._get_detail('short_desc') def get_product(self): return self._get_detail('product') def get_component(self): return self._get_detail('component') def get_description(self): comment = self.bug.findall('//long_desc')[0] return comment.find('.//thetext').text
def __init__(self, base, nb): self.bug = Bugz(base).get(nb) if self.bug is None: raise Exception('Failed to create bug')