Example #1
0
    def getProduct(self, version, dbpath=None, flavor=None):
        """
        return the Product of the requested version or None if not found.
        This returned Product's db attribute will be set to None.

        @param version : the desired version
        @param dbpath    a database path to set on the returned product
        @param flavor    a platform flavor to set on the returned product
        @return    the product description as a Product instance
        """
        try:
            versdata = self.versions[version]
            tags = map(lambda item: item[0],
                       filter(lambda x: x[1] == version, self.tags.items()))
            out = Product(
                self.name,
                version,
                flavor,
                versdata[0],  # the install directory
                versdata[1],  # the table file
                tags,
                dbpath)
            if versdata[2]:
                out._table = versdata[2]
            return out

        except KeyError:
            raise ProductNotFound(self.name, version)
Example #2
0
    def getProduct(self, version, dbpath=None, flavor=None):
        """
        return the Product of the requested version or None if not found.
        This returned Product's db attribute will be set to None.

        @param version : the desired version
        @param dbpath    a database path to set on the returned product
        @param flavor    a platform flavor to set on the returned product
        @return    the product description as a Product instance
        """
        try:
            versdata = self.versions[version]
            tags = [item[0] for item in [x for x in self.tags.items() if x[1] == version]]
            out = Product(self.name, version, flavor, 
                          versdata[0],    # the install directory
                          versdata[1],    # the table file
                          tags, dbpath)
            if versdata[2]:
                out._table = versdata[2]
            return out
                           
        except KeyError:
            raise ProductNotFound(self.name, version)