gi2xl/utils/curl_utils.py
def read_all_pages(repo_url, username, auth_token=None):
    """
    Loops through all pages of a git repo's issues page.

    Args:
        repo_url (str): url of a git repo's issue page in the format:
            https://api.github.com/repos/org/repo/issues
        username (str): github username.
        auth_token (str): github authentication token.

    Returns:
        list: list of the json outputs as str for each page of issues.

    """

    # reads the first page
    first_header, first_json = get_issues_json(repo_url, username, auth_token)
    print("parsing json for page: {}".format(repo_url))
    # gets the second and last page from the first header
    prev_page, next_page, last_page = parse_header(first_header)

    # initialises lists for use in loop
    json_list = [first_json]
    parsed_pages = []

    # loops through all pages
    while next_page not in parsed_pages:
        # todo: add a check to see if the rate limit has been exceeded
        # gets the json for the next_page
        next_header, next_json = get_issues_json(
            next_page, username, auth_token
        )
        json_list.append(next_json)
        # makes a note of the pages which have been parsed
        parsed_pages.append(next_page)
        print("parsing json for page: {}".format(next_page))
        # gets the urls for the next page
        next_page = parse_header(next_header)[1]

    return json_list

    Loops through all pages of a git repo's issues page.

    Args:
        repo_url (str): url of a git repo's issue page in the format:
            https://api.github.com/repos/org/repo/issues
        username (str): github username.
        auth_token (str): github authentication token.

    Returns:
        list: list of the json outputs as str for each page of issues.

    
Loops through all pages of a git repo's issues page.
Loops through all pages of a git repo ' s issues page .
def read_all_pages(repo_url, username, auth_token=None):
    first_header, first_json = get_issues_json(repo_url, username, auth_token)
    print("parsing json for page: {}".format(repo_url))
    prev_page, next_page, last_page = parse_header(first_header)
    json_list = [first_json]
    parsed_pages = []
    while next_page not in parsed_pages:
        next_header, next_json = get_issues_json(
            next_page, username, auth_token
        )
        json_list.append(next_json)
        parsed_pages.append(next_page)
        print("parsing json for page: {}".format(next_page))
        next_page = parse_header(next_header)[1]
    return json_list
def read_all_pages ( repo_url , username , auth_token = None ) : first_header , first_json = get_issues_json ( repo_url , username , auth_token ) print ( "parsing json for page: {}" . format ( repo_url ) ) prev_page , next_page , last_page = parse_header ( first_header ) json_list = [ first_json ] parsed_pages = [ ] while next_page not in parsed_pages : next_header , next_json = get_issues_json ( next_page , username , auth_token ) json_list . append ( next_json ) parsed_pages . append ( next_page ) print ( "parsing json for page: {}" . format ( next_page ) ) next_page = parse_header ( next_header ) [ 1 ] return json_list
Loops through all pages of a git repo's issues page.
Loops through all pages of a git repo ' s issues page .
"""
    Loops through all pages of a git repo's issues page.

    Args:
        repo_url (str): url of a git repo's issue page in the format:
            https://api.github.com/repos/org/repo/issues
        username (str): github username.
        auth_token (str): github authentication token.

    Returns:
        list: list of the json outputs as str for each page of issues.

    """ # reads the first page # gets the second and last page from the first header # initialises lists for use in loop # loops through all pages # todo: add a check to see if the rate limit has been exceeded # gets the json for the next_page # makes a note of the pages which have been parsed # gets the urls for the next page
list of the json outputs as str for each page of issues.
list of the json outputs as str for each page of issues .
list
repo_url
None
username
None
auth_token
github authentication token.
github authentication token .