mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Run formatting tools
This commit is contained in:
parent
3efec53f51
commit
0bae009189
@ -3,8 +3,7 @@ from contextlib import asynccontextmanager
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path, PurePath
|
from pathlib import Path, PurePath
|
||||||
# TODO In Python 3.9 and above, AsyncContextManager is deprecated
|
# TODO In Python 3.9 and above, AsyncContextManager is deprecated
|
||||||
from typing import (Any, AsyncContextManager, AsyncIterator, Awaitable,
|
from typing import Any, AsyncContextManager, AsyncIterator, Awaitable, Callable, Dict, Optional, TypeVar
|
||||||
Callable, Dict, Optional, TypeVar)
|
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from rich.markup import escape
|
from rich.markup import escape
|
||||||
|
@ -7,11 +7,11 @@ from enum import Enum
|
|||||||
from pathlib import PurePath
|
from pathlib import PurePath
|
||||||
# TODO In Python 3.9 and above, AsyncContextManager is deprecated
|
# TODO In Python 3.9 and above, AsyncContextManager is deprecated
|
||||||
from typing import Any, Dict, List, Optional, Set, Union
|
from typing import Any, Dict, List, Optional, Set, Union
|
||||||
from urllib.parse import (parse_qs, urlencode, urljoin, urlparse, urlsplit,
|
from urllib.parse import parse_qs, urlencode, urljoin, urlparse, urlsplit, urlunsplit
|
||||||
urlunsplit)
|
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from bs4 import BeautifulSoup, Tag
|
from bs4 import BeautifulSoup, Tag
|
||||||
|
|
||||||
from PFERD.output_dir import Redownload
|
from PFERD.output_dir import Redownload
|
||||||
from PFERD.utils import soupify
|
from PFERD.utils import soupify
|
||||||
|
|
||||||
|
@ -9,8 +9,7 @@ from datetime import datetime
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from pathlib import Path, PurePath
|
from pathlib import Path, PurePath
|
||||||
# TODO In Python 3.9 and above, AsyncContextManager is deprecated
|
# TODO In Python 3.9 and above, AsyncContextManager is deprecated
|
||||||
from typing import (AsyncContextManager, AsyncIterator, BinaryIO, Iterator,
|
from typing import AsyncContextManager, AsyncIterator, BinaryIO, Iterator, Optional
|
||||||
Optional)
|
|
||||||
|
|
||||||
from rich.markup import escape
|
from rich.markup import escape
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ async def ainput(prompt: str) -> str:
|
|||||||
async def agetpass(prompt: str) -> str:
|
async def agetpass(prompt: str) -> str:
|
||||||
return await to_thread(lambda: getpass.getpass(prompt))
|
return await to_thread(lambda: getpass.getpass(prompt))
|
||||||
|
|
||||||
|
|
||||||
def soupify(data: bytes) -> bs4.BeautifulSoup:
|
def soupify(data: bytes) -> bs4.BeautifulSoup:
|
||||||
"""
|
"""
|
||||||
Parses HTML to a beautifulsoup object.
|
Parses HTML to a beautifulsoup object.
|
||||||
@ -32,6 +33,7 @@ def soupify(data: bytes) -> bs4.BeautifulSoup:
|
|||||||
|
|
||||||
return bs4.BeautifulSoup(data, "html.parser")
|
return bs4.BeautifulSoup(data, "html.parser")
|
||||||
|
|
||||||
|
|
||||||
async def prompt_yes_no(query: str, default: Optional[bool]) -> bool:
|
async def prompt_yes_no(query: str, default: Optional[bool]) -> bool:
|
||||||
"""
|
"""
|
||||||
Asks the user a yes/no question and returns their choice.
|
Asks the user a yes/no question and returns their choice.
|
||||||
|
Loading…
Reference in New Issue
Block a user