Skip to content

Bulk asynchronous downloader for multiple file hosts

Update ui.py

Jacob5603fdcddcda
diff --git a/cyberdrop_dl/ui/ui.py b/cyberdrop_dl/ui/ui.py
index f31b6c716..4e811bcdf 100644
--- a/cyberdrop_dl/ui/ui.py
+++ b/cyberdrop_dl/ui/ui.py
@@ -1,18 +1,17 @@
from __future__ import annotations
+import asyncio
from pathlib import Path
-from rich.markdown import Markdown
from textwrap import dedent
from typing import TYPE_CHECKING
+import aiofiles
from InquirerPy import inquirer
from InquirerPy.validator import PathValidator
+from aiohttp import request
from rich import print as rprint
from rich.console import Console
-
-import aiofiles
-from aiohttp import request
-import asyncio
+from rich.markdown import Markdown
from cyberdrop_dl import __version__
from cyberdrop_dl.clients.hash_client import hash_directory_scanner
@@ -209,8 +208,8 @@ def program_ui(manager: Manager):
changelog_path = manager.path_manager.config_dir.parent / "CHANGELOG.md"
changelog_content = asyncio.run(_get_changelog(changelog_path))
- with console.pager(links = True):
- console.print(Markdown(changelog_content , justify = "left"))
+ with console.pager(links=True):
+ console.print(Markdown(changelog_content, justify="left"))
# Exit
elif action == 13:
@@ -219,16 +218,16 @@ def program_ui(manager: Manager):
async def _get_changelog(changelog_path: Path):
url = "https://raw.githubusercontent.com/jbsparrow/CyberDropDownloader/refs/heads/master/CHANGELOG.md"
- _ , lastest_version = await check_latest_pypi(log_to_console = False)
+ _, lastest_version = await check_latest_pypi(log_to_console=False)
latest_changelog = changelog_path.with_name(f"{changelog_path.stem}_{lastest_version}{changelog_path.suffix}")
if not latest_changelog.is_file():
changelog_pattern = f"{changelog_path.stem}*{changelog_path.suffix}"
for old_changelog in changelog_path.parent.glob(changelog_pattern):
- old_changelog.unlink()
+ old_changelog.unlink()
try:
async with request("GET", url) as response:
response.raise_for_status()
- async with aiofiles.open(latest_changelog, 'wb') as f:
+ async with aiofiles.open(latest_changelog, 'wb') as f:
await f.write(await response.read())
except Exception:
return "UNABLE TO GET CHANGELOG INFORMATION"
@@ -236,6 +235,5 @@ async def _get_changelog(changelog_path: Path):
changelog_lines = latest_changelog.read_text(encoding="utf8").splitlines()
# remove keep_a_changelog disclaimer
changelog_content = "\n".join(changelog_lines[:4] + changelog_lines[6:])
-
+
return changelog_content
-
\ No newline at end of file