Re-order all imports across project with isort

This commit is contained in:
rlaphoenix 2023-02-10 19:24:47 +00:00
parent faabfb550c
commit d982e37ee5
19 changed files with 36 additions and 40 deletions

View File

@ -15,7 +15,7 @@ from functools import partial
from http.cookiejar import MozillaCookieJar from http.cookiejar import MozillaCookieJar
from pathlib import Path from pathlib import Path
from threading import Event from threading import Event
from typing import Any, Optional, Callable from typing import Any, Callable, Optional
import click import click
import jsonpickle import jsonpickle
@ -27,18 +27,18 @@ from pywidevine.remotecdm import RemoteCdm
from tqdm import tqdm from tqdm import tqdm
from devine.core.config import config from devine.core.config import config
from devine.core.constants import AnyTrack, context_settings, LOG_FORMATTER, DRM_SORT_MAP from devine.core.constants import DRM_SORT_MAP, LOG_FORMATTER, AnyTrack, context_settings
from devine.core.drm import Widevine, DRM_T from devine.core.credential import Credential
from devine.core.proxies import Basic, NordVPN, Hola from devine.core.drm import DRM_T, Widevine
from devine.core.proxies import Basic, Hola, NordVPN
from devine.core.service import Service from devine.core.service import Service
from devine.core.services import Services from devine.core.services import Services
from devine.core.titles import Title_T, Movie, Song from devine.core.titles import Movie, Song, Title_T
from devine.core.titles.episode import Episode from devine.core.titles.episode import Episode
from devine.core.tracks import Audio, Video from devine.core.tracks import Audio, Video
from devine.core.utilities import is_close_match, get_binary_path from devine.core.utilities import get_binary_path, is_close_match
from devine.core.utils.click_types import LANGUAGE_RANGE, QUALITY, SEASON_RANGE, ContextData from devine.core.utils.click_types import LANGUAGE_RANGE, QUALITY, SEASON_RANGE, ContextData
from devine.core.utils.collections import merge_dict from devine.core.utils.collections import merge_dict
from devine.core.credential import Credential
from devine.core.utils.subprocess import ffprobe from devine.core.utils.subprocess import ffprobe
from devine.core.vaults import Vaults from devine.core.vaults import Vaults

View File

@ -7,10 +7,10 @@ from typing import Optional
import click import click
from devine.core.vault import Vault
from devine.core.config import config from devine.core.config import config
from devine.core.constants import context_settings from devine.core.constants import context_settings
from devine.core.services import Services from devine.core.services import Services
from devine.core.vault import Vault
from devine.core.vaults import Vaults from devine.core.vaults import Vaults

View File

@ -6,7 +6,7 @@ import coloredlogs
from devine.core import __version__ from devine.core import __version__
from devine.core.commands import Commands from devine.core.commands import Commands
from devine.core.constants import context_settings, LOG_FORMAT from devine.core.constants import LOG_FORMAT, context_settings
@click.command(cls=Commands, invoke_without_command=True, context_settings=context_settings) @click.command(cls=Commands, invoke_without_command=True, context_settings=context_settings)

View File

@ -4,14 +4,13 @@ import zlib
from datetime import datetime, timedelta from datetime import datetime, timedelta
from os import stat_result from os import stat_result
from pathlib import Path from pathlib import Path
from typing import Optional, Any, Union from typing import Any, Optional, Union
import jsonpickle import jsonpickle
import jwt import jwt
from devine.core.config import config from devine.core.config import config
EXP_T = Union[datetime, str, int, float] EXP_T = Union[datetime, str, int, float]

View File

@ -1,7 +1,6 @@
import logging import logging
from typing import TypeVar, Union from typing import TypeVar, Union
LOG_FORMAT = "{asctime} [{levelname[0]}] {name} : {message}" # must be '{}' style LOG_FORMAT = "{asctime} [{levelname[0]}] {name} : {message}" # must be '{}' style
LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
LOG_FORMATTER = logging.Formatter(LOG_FORMAT, LOG_DATE_FORMAT, "{") LOG_FORMATTER = logging.Formatter(LOG_FORMAT, LOG_DATE_FORMAT, "{")

View File

@ -1,7 +1,7 @@
import asyncio import asyncio
import subprocess import subprocess
from pathlib import Path from pathlib import Path
from typing import Union, Optional from typing import Optional, Union
from devine.core.config import config from devine.core.config import config
from devine.core.utilities import get_binary_path, start_pproxy from devine.core.utilities import get_binary_path, start_pproxy

View File

@ -1,6 +1,6 @@
import subprocess import subprocess
from pathlib import Path from pathlib import Path
from typing import Union, Optional from typing import Optional, Union
from devine.core.utilities import get_binary_path from devine.core.utilities import get_binary_path

View File

@ -2,7 +2,7 @@ from __future__ import annotations
import re import re
from hashlib import md5 from hashlib import md5
from typing import Union, Any, Optional from typing import Any, Optional, Union
import m3u8 import m3u8
import requests import requests
@ -12,8 +12,8 @@ from pywidevine.cdm import Cdm as WidevineCdm
from pywidevine.pssh import PSSH from pywidevine.pssh import PSSH
from requests import Session from requests import Session
from devine.core.drm import ClearKey, Widevine, DRM_T from devine.core.drm import DRM_T, ClearKey, Widevine
from devine.core.tracks import Tracks, Video, Audio, Subtitle from devine.core.tracks import Audio, Subtitle, Tracks, Video
from devine.core.utilities import is_close_match from devine.core.utilities import is_close_match

View File

@ -3,21 +3,21 @@ from __future__ import annotations
import base64 import base64
import logging import logging
from abc import ABCMeta, abstractmethod from abc import ABCMeta, abstractmethod
from http.cookiejar import MozillaCookieJar, CookieJar from http.cookiejar import CookieJar, MozillaCookieJar
from typing import Optional, Union from typing import Optional, Union
from urllib.parse import urlparse from urllib.parse import urlparse
import click import click
import requests import requests
from requests.adapters import Retry, HTTPAdapter from requests.adapters import HTTPAdapter, Retry
from devine.core.cacher import Cacher
from devine.core.config import config from devine.core.config import config
from devine.core.constants import AnyTrack from devine.core.constants import AnyTrack
from devine.core.titles import Titles_T, Title_T from devine.core.credential import Credential
from devine.core.titles import Title_T, Titles_T
from devine.core.tracks import Chapter, Tracks from devine.core.tracks import Chapter, Tracks
from devine.core.utilities import get_ip_info from devine.core.utilities import get_ip_info
from devine.core.cacher import Cacher
from devine.core.credential import Credential
class Service(metaclass=ABCMeta): class Service(metaclass=ABCMeta):

View File

@ -2,8 +2,7 @@ from typing import Union
from .episode import Episode, Series from .episode import Episode, Series
from .movie import Movie, Movies from .movie import Movie, Movies
from .song import Song, Album from .song import Album, Song
Title_T = Union[Movie, Episode, Song] Title_T = Union[Movie, Episode, Song]
Titles_T = Union[Movies, Series, Album] Titles_T = Union[Movies, Series, Album]

View File

@ -1,7 +1,7 @@
import re import re
from abc import ABC from abc import ABC
from collections import Counter from collections import Counter
from typing import Any, Optional, Union, Iterable from typing import Any, Iterable, Optional, Union
from langcodes import Language from langcodes import Language
from pymediainfo import MediaInfo from pymediainfo import MediaInfo

View File

@ -1,5 +1,5 @@
from abc import ABC from abc import ABC
from typing import Any, Optional, Union, Iterable from typing import Any, Iterable, Optional, Union
from langcodes import Language from langcodes import Language
from pymediainfo import MediaInfo from pymediainfo import MediaInfo

View File

@ -1,5 +1,5 @@
from abc import ABC from abc import ABC
from typing import Any, Optional, Union, Iterable from typing import Any, Iterable, Optional, Union
from langcodes import Language from langcodes import Language
from pymediainfo import MediaInfo from pymediainfo import MediaInfo

View File

@ -1,7 +1,7 @@
from __future__ import annotations from __future__ import annotations
from abc import abstractmethod from abc import abstractmethod
from typing import Optional, Union, Any from typing import Any, Optional, Union
from langcodes import Language from langcodes import Language
from pymediainfo import MediaInfo from pymediainfo import MediaInfo

View File

@ -1,6 +1,6 @@
from .audio import Audio from .audio import Audio
from .track import Track
from .chapter import Chapter from .chapter import Chapter
from .subtitle import Subtitle from .subtitle import Subtitle
from .track import Track
from .tracks import Tracks from .tracks import Tracks
from .video import Video from .video import Video

View File

@ -11,11 +11,11 @@ from langcodes import Language, closest_supported_match
from devine.core.config import config from devine.core.config import config
from devine.core.constants import LANGUAGE_MAX_DISTANCE, LANGUAGE_MUX_MAP, AnyTrack, TrackT from devine.core.constants import LANGUAGE_MAX_DISTANCE, LANGUAGE_MUX_MAP, AnyTrack, TrackT
from devine.core.tracks.audio import Audio from devine.core.tracks.audio import Audio
from devine.core.tracks.track import Track
from devine.core.tracks.chapter import Chapter from devine.core.tracks.chapter import Chapter
from devine.core.tracks.subtitle import Subtitle from devine.core.tracks.subtitle import Subtitle
from devine.core.tracks.track import Track
from devine.core.tracks.video import Video from devine.core.tracks.video import Video
from devine.core.utilities import sanitize_filename, is_close_match from devine.core.utilities import is_close_match, sanitize_filename
from devine.core.utils.collections import as_list, flatten from devine.core.utils.collections import as_list, flatten

View File

@ -11,9 +11,9 @@ from typing import Any, Optional, Union
from langcodes import Language from langcodes import Language
from devine.core.config import config from devine.core.config import config
from devine.core.tracks.track import Track
from devine.core.tracks.subtitle import Subtitle from devine.core.tracks.subtitle import Subtitle
from devine.core.utilities import get_binary_path, get_boxes, FPS from devine.core.tracks.track import Track
from devine.core.utilities import FPS, get_binary_path, get_boxes
class Video(Track): class Video(Track):

View File

@ -4,15 +4,14 @@ import importlib.util
import re import re
import shutil import shutil
import sys import sys
import unicodedata
from pathlib import Path
from types import ModuleType
from typing import AsyncIterator, Optional, Sequence, Union
from urllib.parse import urlparse from urllib.parse import urlparse
import pproxy import pproxy
import requests import requests
import unicodedata
from pathlib import Path
from types import ModuleType
from typing import Optional, Union, Sequence, AsyncIterator
from langcodes import Language, closest_match from langcodes import Language, closest_match
from pymp4.parser import Box from pymp4.parser import Box
from unidecode import unidecode from unidecode import unidecode

View File

@ -1,11 +1,11 @@
from __future__ import annotations from __future__ import annotations
from typing import Iterator, Optional, Union, Any from typing import Any, Iterator, Optional, Union
from uuid import UUID from uuid import UUID
from devine.core.vault import Vault
from devine.core.config import config from devine.core.config import config
from devine.core.utilities import import_module_by_path from devine.core.utilities import import_module_by_path
from devine.core.vault import Vault
_VAULTS = sorted( _VAULTS = sorted(
( (