third_party/blink/tools/blinkpy/w3c/wpt_github.py
def extract_link_next(link_header):
        """Extracts the URI to the next page of results from a response.

        As per GitHub API specs, the link to the next page of results is
        extracted from the Link header -- the link with relation type "next".
        Docs: https://developer.github.com/v3/#pagination (and RFC 5988)

        Args:
            link_header: The value of the Link header in responses from GitHub.

        Returns:
            Path to the next page (without base URL), or None if not found.
        """
        # TODO(robertma): Investigate "may require expansion as URI templates" mentioned in docs.
        # Example Link header:
        # <https://api.github.com/resources?page=3>; rel="next", <https://api.github.com/resources?page=50>; rel="last"
        if link_header is None:
            return None
        link_re = re.compile(r'<(.+?)>; *rel="(.+?)"')
        match = link_re.search(link_header)
        while match:
            link, rel = match.groups()
            if rel.lower() == 'next':
                # Strip API_BASE so that the return value is useful for request().
                assert link.startswith(API_BASE)
                return link[len(API_BASE):]
            match = link_re.search(link_header, match.end())
        return None
Extracts the URI to the next page of results from a response.

        As per GitHub API specs, the link to the next page of results is
        extracted from the Link header -- the link with relation type "next".
        Docs: https://developer.github.com/v3/#pagination (and RFC 5988)

        Args:
            link_header: The value of the Link header in responses from GitHub.

        Returns:
            Path to the next page (without base URL), or None if not found.
        
Extracts the URI to the next page of results from a response.
As per GitHub API specs, the link to the next page of results is
extracted from the Link header -- the link with relation type "next".
Extracts the URI to the next page of results from a response . As per GitHub API specs the link to the next page of results is extracted from the Link header -- the link with relation type " next " .
def extract_link_next(link_header):
        if link_header is None:
            return None
        link_re = re.compile(r'<(.+?)>; *rel="(.+?)"')
        match = link_re.search(link_header)
        while match:
            link, rel = match.groups()
            if rel.lower() == 'next':
                assert link.startswith(API_BASE)
                return link[len(API_BASE):]
            match = link_re.search(link_header, match.end())
        return None
def extract_link_next ( link_header ) : if link_header is None : return None link_re = re . compile ( r'<(.+?)>; *rel="(.+?)"' ) match = link_re . search ( link_header ) while match : link , rel = match . groups ( ) if rel . lower ( ) == 'next' : assert link . startswith ( API_BASE ) return link [ len ( API_BASE ) : ] match = link_re . search ( link_header , match . end ( ) ) return None
Extracts the URI to the next page of results from a response.
Extracts the URI to the next page of results from a response .
"""Extracts the URI to the next page of results from a response.

        As per GitHub API specs, the link to the next page of results is
        extracted from the Link header -- the link with relation type "next".
        Docs: https://developer.github.com/v3/#pagination (and RFC 5988)

        Args:
            link_header: The value of the Link header in responses from GitHub.

        Returns:
            Path to the next page (without base URL), or None if not found.
        """ # TODO(robertma): Investigate "may require expansion as URI templates" mentioned in docs. # Example Link header: # <https://api.github.com/resources?page=3>; rel="next", <https://api.github.com/resources?page=50>; rel="last" # Strip API_BASE so that the return value is useful for request().
Path to the next page (without base URL), or None if not found.
Path to the next page ( without base URL ) or None if not found .
link_header
The value of the Link header in responses from GitHub.
The value of the Link header in responses from GitHub .