##// END OF EJS Templates
Update output streams so we can redirect stdout with only stats to a file....
Fernando Perez -
Show More
@@ -49,10 +49,11 b' def get_auth_token():'
49 49 return token
50 50
51 51 print("Please enter your github username and password. These are not "
52 "stored, only used to get an oAuth token. You can revoke this at "
53 "any time on Github.")
54 user = input("Username: ")
55 pw = getpass.getpass("Password: ")
52 "stored, only used to get an oAuth token. You can revoke this at "
53 "any time on Github.\n"
54 "Username: ", file=sys.stderr, end='')
55 user = input('')
56 pw = getpass.getpass("Password: ", stream=sys.stderr)
56 57
57 58 auth_request = {
58 59 "scopes": [
@@ -64,9 +65,10 b' def get_auth_token():'
64 65 }
65 66 response = requests.post('https://api.github.com/authorizations',
66 67 auth=(user, pw), data=json.dumps(auth_request))
67 if response.status_code == 401 and response.headers.get('X-GitHub-OTP') == 'required; sms':
68 print("Your login API resquest a SMS one time password")
69 sms_pw = getpass.getpass("SMS password: ")
68 if response.status_code == 401 and \
69 response.headers.get('X-GitHub-OTP') == 'required; sms':
70 print("Your login API resquest a SMS one time password", file=sys.stderr)
71 sms_pw = getpass.getpass("SMS password: ", stream=sys.stderr)
70 72 response = requests.post('https://api.github.com/authorizations',
71 73 auth=(user, pw),
72 74 data=json.dumps(auth_request),
General Comments 0
You need to be logged in to leave comments. Login now