Exemplo n.º 1
0
def login(args):
    """
    Log into a GitHub instance, and print the resulting OAuth token.
    """
    with cli.catch_api_errors():
        client = GithubAPIClient(nickname=args.github)
        login_if_needed(client, args.scope, comment=args.comment)

        oauth_token_key = envkey(client.nickname, 'oauth_token')
        print("export {0}='{1}'".format(oauth_token_key, client.token))
Exemplo n.º 2
0
def login(args):
    """
    Log into a GitHub instance, and print the resulting OAuth token.
    """
    with cli.catch_api_errors():
        client = GithubAPIClient(nickname=args.github)
        login_if_needed(client, args.scope, comment=args.comment)

        oauth_token_key = envkey(client.nickname, "oauth_token")
        print("export {0}='{1}'".format(oauth_token_key, client.token))
Exemplo n.º 3
0
def test_envkey():
    assert_equal(envkey('foo', 'bar'), 'GITHUB_FOO_BAR')
    assert_equal(envkey('foo', 'baz_bat'), 'GITHUB_FOO_BAZ_BAT')