예제 #1
0
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
예제 #2
0
 def __init__(self, base, nb):
     self.bug = Bugz(base).get(nb)
     if self.bug is None:
         raise Exception('Failed to create bug')