예제 #1
0
def get_gitlab():
    """Return a logged-in instance of the gitlab client.

    Authenticate the client. If the authentication fails with an Unauthorized error,
    ask the user to provide the token again and retry.
    """
    gitlab = GitlabClient()
    try:
        gitlab.login(get_token(gitlab.url))
    except Unauthorized, e:
        print "Could not authenticate with Gitlab: {}".format(e.message)
        print "It looks like your token is wrong."
        reset_token()
        return get_gitlab()
예제 #2
0
파일: cli.py 프로젝트: folpindo/gitgitlab
def get_gitlab():
    """Return a logged-in instance of the gitlab client.

    Authenticate the client. If the authentication fails with an Unauthorized error,
    ask the user to provide the token again and retry.
    """
    gitlab = GitlabClient()
    try:
        gitlab.login(get_token(gitlab.url))
    except Unauthorized, e:
        print "Could not authenticate with Gitlab: {}".format(e.message)
        print "It looks like your token is wrong."
        reset_token()
        return get_gitlab()
예제 #3
0
def auth():
    """Reset the authentication token."""
    reset_token()
예제 #4
0
파일: cli.py 프로젝트: folpindo/gitgitlab
def auth():
    """Reset the authentication token."""
    reset_token()