mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2025-10-23 15:11:08 +00:00
chore(api): fix import ordering in download_manager and handlers
This commit is contained in:
@@ -6,11 +6,11 @@ import sys
|
|||||||
import tempfile
|
import tempfile
|
||||||
import threading
|
import threading
|
||||||
import uuid
|
import uuid
|
||||||
|
from contextlib import suppress
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
|
from datetime import datetime, timedelta
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Callable, Dict, List, Optional
|
from typing import Any, Callable, Dict, List, Optional
|
||||||
from datetime import datetime, timedelta
|
|
||||||
from contextlib import suppress
|
|
||||||
|
|
||||||
log = logging.getLogger("download_manager")
|
log = logging.getLogger("download_manager")
|
||||||
|
|
||||||
@@ -87,14 +87,15 @@ def _perform_download(
|
|||||||
if cancel_event and cancel_event.is_set():
|
if cancel_event and cancel_event.is_set():
|
||||||
raise Exception(f"Job was cancelled {stage}")
|
raise Exception(f"Job was cancelled {stage}")
|
||||||
|
|
||||||
|
from contextlib import redirect_stderr, redirect_stdout
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from contextlib import redirect_stdout, redirect_stderr
|
|
||||||
|
|
||||||
_check_cancel("before execution started")
|
_check_cancel("before execution started")
|
||||||
|
|
||||||
# Import dl.py components lazily to avoid circular deps during module import
|
# Import dl.py components lazily to avoid circular deps during module import
|
||||||
import click
|
import click
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from unshackle.commands.dl import dl
|
from unshackle.commands.dl import dl
|
||||||
from unshackle.core.config import config
|
from unshackle.core.config import config
|
||||||
from unshackle.core.services import Services
|
from unshackle.core.services import Services
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ def initialize_proxy_providers() -> List[Any]:
|
|||||||
proxy_providers = []
|
proxy_providers = []
|
||||||
try:
|
try:
|
||||||
from unshackle.core import binaries
|
from unshackle.core import binaries
|
||||||
|
|
||||||
# Load the main unshackle config to get proxy provider settings
|
# Load the main unshackle config to get proxy provider settings
|
||||||
from unshackle.core.config import config as main_config
|
from unshackle.core.config import config as main_config
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user