def get_code(client_id):
"""
Opens a browser so the user can give us the auth code
Args:
client_id (str): client id for the app we want to use
Returns:
str: auth code user provided
"""
url = FITBIT_PERMISSION_SCREEN.format(
client_id=client_id,
scope='nutrition'
)
webbrowser.open_new(url)
print(
"I am attempting to get permission to run. "
"A browser should have just opened. If it has not please go to {}".format(
url
)
)
return input(
"A browser should have just opened: please provide the the text after 'code=' so I can continue: "
)
评论列表
文章目录