Skip to content

annotated return types for request_codes(self), wait_for_authorizatio… #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions adafruit_oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
# Refresh tokens are valid until the user revokes access
self.refresh_token = refresh_token

def request_codes(self):
def request_codes(self) -> None:
"""Identifies your application and access scopes with Google's
authorization server. Attempts to request device and user codes
"""
Expand All @@ -118,7 +118,7 @@ def request_codes(self):
self.verification_url = json_resp["verification_url"]
self.user_code = json_resp["user_code"]

def wait_for_authorization(self):
def wait_for_authorization(self) -> bool:
"""Blocking method which polls Google's authorization server
until a response from Google's authorization server indicating
that the user has responded to the access request, or until the
Expand Down Expand Up @@ -164,7 +164,7 @@ def wait_for_authorization(self):
self.access_token_scope = json_resp["scope"]
return True

def refresh_access_token(self):
def refresh_access_token(self) -> bool:
"""Refreshes an expired access token.
:return: True if able to refresh an access token, False otherwise.

Expand Down