Example #1
0
class Bugzilla:
    """Backend-agnostic bugzilla interaction class

    This is the preferred way to communicate with bugzilla
    servers."""

    def __init__(self, baseurl):
        """Sets the url of the bugzilla server"""
        self.cgi = CGI(baseurl)

    def get_products(self):
        return self.cgi.get_products()

    def get_components(self, product):
        return self.cgi.get_components(product)

    def get_versions(self, product):
        return self.cgi.get_versions(product)

    def get(self, number):
        """Get a bug through its bug number/id"""

        charts = [[(None, "bug_id", "equals", number)]]
        return self.cgi.query_bchart(charts=charts)[0]

    def query(self, charts=None, str=None):
        """Query the bugzilla server using boolean charts

        Returns a list of bugs which match the query.

        The chart can be passed as a chart list or as a
        string, see the descriptions on the modules cgi
        and bchart
        """
        return self.cgi.query_bchart(charts=charts, str=str)
Example #2
0
 def __init__(self, baseurl):
     """Sets the url of the bugzilla server"""
     self.cgi = CGI(baseurl)