api: Update typehints
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from io import BytesIO
|
||||
from typing import Optional, Tuple
|
||||
from typing import Optional
|
||||
|
||||
import backoff
|
||||
from aiohttp import ClientResponseError
|
||||
@@ -63,7 +63,7 @@ async def fetch_cookies(username: str, password: str) -> dict:
|
||||
@backoff.on_exception(backoff.expo, ClientResponseError, max_time=15)
|
||||
async def fetch_story_from_partId(
|
||||
part_id: int, cookies: Optional[dict] = None
|
||||
) -> Tuple[int, Story]:
|
||||
) -> tuple[int, Story]:
|
||||
"""Fetch Story metadata from a Part ID."""
|
||||
with start_action(action_type="api_fetch_storyFromPartId"):
|
||||
async with CachedSession(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import List, Optional, TypedDict
|
||||
from typing import Optional, TypedDict
|
||||
|
||||
|
||||
class CopyrightData(TypedDict):
|
||||
@@ -34,9 +34,9 @@ class Story(TypedDict):
|
||||
description: str
|
||||
cover: str
|
||||
completed: bool
|
||||
tags: List[str]
|
||||
tags: list[str]
|
||||
mature: bool
|
||||
url: str
|
||||
parts: List[Part]
|
||||
parts: list[Part]
|
||||
isPaywalled: bool
|
||||
copyright: int
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import re
|
||||
import unicodedata
|
||||
from typing import cast
|
||||
|
||||
import bs4
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from .models import Part
|
||||
|
||||
|
||||
def slugify(value, allow_unicode=False) -> str:
|
||||
|
||||
Reference in New Issue
Block a user