perceval/backends/core/gitlab.py
def fetch_items(self, path, payload):
        """Return the items from GitLab API using links pagination"""

        page = 0  # current page
        last_page = None  # last page
        url_next = urijoin(self.base_url, GitLabClient.PROJECTS, self.owner + '%2F' + self.repository, path)

        logger.debug("Get GitLab paginated items from " + url_next)

        response = self.fetch(url_next, payload=payload)

        items = response.text
        page += 1

        if 'last' in response.links:
            last_url = response.links['last']['url']
            last_page = last_url.split('&page=')[1].split('&')[0]
            last_page = int(last_page)
            logger.debug("Page: %i/%i" % (page, last_page))

        while items:
            yield items

            items = None

            if 'next' in response.links:
                url_next = response.links['next']['url']  # Loving requests :)
                response = self.fetch(url_next, payload=payload)
                page += 1

                items = response.text
                logger.debug("Page: %i/%i" % (page, last_page))
def fetch_items(self, path, payload):
        page = 0  # current page
        last_page = None  # last page
        url_next = urijoin(self.base_url, GitLabClient.PROJECTS, self.owner + '%2F' + self.repository, path)

        logger.debug("Get GitLab paginated items from " + url_next)

        response = self.fetch(url_next, payload=payload)

        items = response.text
        page += 1

        if 'last' in response.links:
            last_url = response.links['last']['url']
            last_page = last_url.split('&page=')[1].split('&')[0]
            last_page = int(last_page)
            logger.debug("Page: %i/%i" % (page, last_page))

        while items:
            yield items

            items = None

            if 'next' in response.links:
                url_next = response.links['next']['url']  # Loving requests :)
                response = self.fetch(url_next, payload=payload)
                page += 1

                items = response.text
                logger.debug("Page: %i/%i" % (page, last_page))
def fetch_items ( self , path , payload ) : page = 0 # current page last_page = None # last page url_next = urijoin ( self . base_url , GitLabClient . PROJECTS , self . owner + '%2F' + self . repository , path ) logger . debug ( "Get GitLab paginated items from " + url_next ) response = self . fetch ( url_next , payload = payload ) items = response . text page += 1 if 'last' in response . links : last_url = response . links [ 'last' ] [ 'url' ] last_page = last_url . split ( '&page=' ) [ 1 ] . split ( '&' ) [ 0 ] last_page = int ( last_page ) logger . debug ( "Page: %i/%i" % ( page , last_page ) ) while items : yield items items = None if 'next' in response . links : url_next = response . links [ 'next' ] [ 'url' ] # Loving requests :) response = self . fetch ( url_next , payload = payload ) page += 1 items = response . text logger . debug ( "Page: %i/%i" % ( page , last_page ) )
Return the items from GitLab API using links pagination
Return the items from GitLab API using links pagination