perceval/backends/core/launchpad.py
def __fetch_items(self, path, payload):
        """Return the items from Launchpad API using pagination"""

        page = 0  # current page
        url_next = path
        fetch_data = True

        while fetch_data:
            logger.debug("Fetching page: %i", page)

            try:
                raw_content = self.__send_request(url_next, payload)
                content = json.loads(raw_content)
            except requests.exceptions.HTTPError as e:
                if e.response.status_code in [410]:
                    logger.warning("Data is not available - %s", url_next)
                    raw_content = '{"total_size": 0, "start": 0, "entries": []}'
                    content = json.loads(raw_content)
                else:
                    raise e

            if 'next_collection_link' in content:
                url_next = content['next_collection_link']
                payload = None
            else:
                fetch_data = False

            yield raw_content
            page += 1
def __fetch_items(self, path, payload):
        page = 0  # current page
        url_next = path
        fetch_data = True

        while fetch_data:
            logger.debug("Fetching page: %i", page)

            try:
                raw_content = self.__send_request(url_next, payload)
                content = json.loads(raw_content)
            except requests.exceptions.HTTPError as e:
                if e.response.status_code in [410]:
                    logger.warning("Data is not available - %s", url_next)
                    raw_content = '{"total_size": 0, "start": 0, "entries": []}'
                    content = json.loads(raw_content)
                else:
                    raise e

            if 'next_collection_link' in content:
                url_next = content['next_collection_link']
                payload = None
            else:
                fetch_data = False

            yield raw_content
            page += 1
def __fetch_items ( self , path , payload ) : page = 0 # current page url_next = path fetch_data = True while fetch_data : logger . debug ( "Fetching page: %i" , page ) try : raw_content = self . __send_request ( url_next , payload ) content = json . loads ( raw_content ) except requests . exceptions . HTTPError as e : if e . response . status_code in [ 410 ] : logger . warning ( "Data is not available - %s" , url_next ) raw_content = '{"total_size": 0, "start": 0, "entries": []}' content = json . loads ( raw_content ) else : raise e if 'next_collection_link' in content : url_next = content [ 'next_collection_link' ] payload = None else : fetch_data = False yield raw_content page += 1
Return the items from Launchpad API using pagination
Return the items from Launchpad API using pagination