Beispiel #1
0
    def lookup(self, identifier):
        """Requests NoveList metadata for a particular identifier

        :return: Metadata object or None
        """

        client_identifier = identifier.urn
        if identifier.type != Identifier.ISBN:
            return self.lookup_equivalent_isbns(identifier)

        params = dict(ClientIdentifier=client_identifier,
                      ISBN=identifier.identifier,
                      version=self.version,
                      profile=self.profile,
                      password=self.password)
        url = self._build_query(params)
        self.log.debug("NoveList lookup: %s", url)
        representation, from_cache = Representation.cacheable_post(
            self._db,
            unicode(url),
            params,
            max_age=self.MAX_REPRESENTATION_AGE,
            response_reviewer=self.review_response)

        return self.lookup_info_to_metadata(representation)
Beispiel #2
0
    def lookup(self, identifier):
        """Requests NoveList metadata for a particular identifier

        :return: Metadata object or None
        """

        client_identifier = identifier.urn
        if identifier.type != Identifier.ISBN:
            return self.lookup_equivalent_isbns(identifier)

        params = dict(
            ClientIdentifier=client_identifier, ISBN=identifier.identifier,
            version=self.version, profile=self.profile, password=self.password
        )
        url = self._build_query(params)
        self.log.debug("NoveList lookup: %s", url)
        representation, from_cache = Representation.cacheable_post(
            self._db, unicode(url), params,
            max_age=self.MAX_REPRESENTATION_AGE,
            response_reviewer=self.review_response
        )

        return self.lookup_info_to_metadata(representation)