fix: replace typing List/Tuple with built-in generics
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
"""Authentication helpers for the Auditui app."""
|
"""Authentication helpers for the Auditui app."""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Tuple
|
|
||||||
|
|
||||||
import audible
|
import audible
|
||||||
|
|
||||||
@@ -10,7 +9,7 @@ from .constants import AUTH_PATH
|
|||||||
|
|
||||||
def authenticate(
|
def authenticate(
|
||||||
auth_path: Path = AUTH_PATH,
|
auth_path: Path = AUTH_PATH,
|
||||||
) -> Tuple[audible.Authenticator, audible.Client]:
|
) -> tuple[audible.Authenticator, audible.Client]:
|
||||||
"""Authenticate with Audible and return authenticator and client."""
|
"""Authenticate with Audible and return authenticator and client."""
|
||||||
if not auth_path.exists():
|
if not auth_path.exists():
|
||||||
raise FileNotFoundError(
|
raise FileNotFoundError(
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
from getpass import getpass
|
from getpass import getpass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Tuple
|
|
||||||
|
|
||||||
import audible
|
import audible
|
||||||
|
|
||||||
@@ -11,7 +10,7 @@ from .constants import AUTH_PATH
|
|||||||
|
|
||||||
def configure(
|
def configure(
|
||||||
auth_path: Path = AUTH_PATH,
|
auth_path: Path = AUTH_PATH,
|
||||||
) -> Tuple[audible.Authenticator, audible.Client]:
|
) -> tuple[audible.Authenticator, audible.Client]:
|
||||||
"""Force re-authentication and save credentials."""
|
"""Force re-authentication and save credentials."""
|
||||||
if auth_path.exists():
|
if auth_path.exists():
|
||||||
response = input(
|
response = input(
|
||||||
@@ -37,4 +36,3 @@ def configure(
|
|||||||
print("Authentication successful!")
|
print("Authentication successful!")
|
||||||
audible_client = audible.Client(auth=authenticator)
|
audible_client = audible.Client(auth=authenticator)
|
||||||
return authenticator, audible_client
|
return authenticator, audible_client
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"""Library helpers for fetching and formatting Audible data."""
|
"""Library helpers for fetching and formatting Audible data."""
|
||||||
|
|
||||||
from typing import Callable, List
|
from typing import Callable
|
||||||
|
|
||||||
import audible
|
import audible
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ class LibraryClient:
|
|||||||
self, response_groups: str, on_progress: ProgressCallback | None = None
|
self, response_groups: str, on_progress: ProgressCallback | None = None
|
||||||
) -> list:
|
) -> list:
|
||||||
"""Fetch all pages of library items from the API."""
|
"""Fetch all pages of library items from the API."""
|
||||||
all_items: List[dict] = []
|
all_items: list[dict] = []
|
||||||
page = 1
|
page = 1
|
||||||
page_size = 50
|
page_size = 50
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user