From 782228581ce93d707b1237c6f5bec39b2b7ddc1d Mon Sep 17 00:00:00 2001 From: Jules-WinnfieldX Date: Wed, 29 May 2024 14:54:35 -0600 Subject: [PATCH] Run configs alphabetically, and output config name on summary and download screen --- cyberdrop_dl/__init__.py | 2 +- cyberdrop_dl/main.py | 4 +-- cyberdrop_dl/managers/progress_manager.py | 3 +- .../ui/progress/downloads_progress.py | 10 +++++-- poetry.lock | 30 +++++++++---------- pyproject.toml | 4 +-- 6 files changed, 29 insertions(+), 24 deletions(-) diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py index be0c07695..bfae7bfbc 100644 --- a/cyberdrop_dl/__init__.py +++ b/cyberdrop_dl/__init__.py @@ -1 +1 @@ -__version__ = "5.3.19" +__version__ = "5.3.21" diff --git a/cyberdrop_dl/main.py b/cyberdrop_dl/main.py index 872375d1f..af73853ca 100644 --- a/cyberdrop_dl/main.py +++ b/cyberdrop_dl/main.py @@ -79,7 +79,7 @@ async def director(manager: Manager) -> None: if len(logger.handlers) > 0: await log("Picking new config...", 20) - configs_to_run = list(set(configs) - set(configs_ran)) + configs_to_run = list(set(configs) - set(configs_ran)).sort() manager.config_manager.change_config(configs_to_run[0]) configs_ran.append(configs_to_run[0]) if len(logger.handlers) > 0: @@ -119,7 +119,7 @@ async def director(manager: Manager) -> None: clear_screen_proc = await asyncio.create_subprocess_shell('cls' if os.name == 'nt' else 'clear') await clear_screen_proc.wait() - await log("Running Post-Download Processes...", 20) + await log(f"Running Post-Download Processes For Config: {manager.config_manager.loaded_config}...", 20) if isinstance(manager.args_manager.sort_downloads, bool): if manager.args_manager.sort_downloads: sorter = Sorter(manager) diff --git a/cyberdrop_dl/managers/progress_manager.py b/cyberdrop_dl/managers/progress_manager.py index be4c6ff60..02610976e 100644 --- a/cyberdrop_dl/managers/progress_manager.py +++ b/cyberdrop_dl/managers/progress_manager.py @@ -16,13 +16,14 @@ class ProgressManager: def __init__(self, manager: 'Manager'): # File Download Bars + self.manager = manager self.file_progress: FileProgress = FileProgress(manager.config_manager.global_settings_data['UI_Options']['downloading_item_limit'], manager) # Scraping Printout self.scraping_progress: ScrapingProgress = ScrapingProgress(manager.config_manager.global_settings_data['UI_Options']['scraping_item_limit'], manager) # Overall Progress Bars & Stats - self.download_progress: DownloadsProgress = DownloadsProgress() + self.download_progress: DownloadsProgress = DownloadsProgress(manager) self.download_stats_progress: DownloadStatsProgress = DownloadStatsProgress() self.scrape_stats_progress: ScrapeStatsProgress = ScrapeStatsProgress() diff --git a/cyberdrop_dl/ui/progress/downloads_progress.py b/cyberdrop_dl/ui/progress/downloads_progress.py index 6a5542aaa..ffa4ae56d 100644 --- a/cyberdrop_dl/ui/progress/downloads_progress.py +++ b/cyberdrop_dl/ui/progress/downloads_progress.py @@ -1,14 +1,18 @@ -from typing import Tuple +from typing import Tuple, TYPE_CHECKING from rich.console import Group from rich.panel import Panel from rich.progress import Progress, BarColumn +if TYPE_CHECKING: + from cyberdrop_dl.managers.manager import Manager + class DownloadsProgress: """Class that keeps track of completed, skipped and failed files""" - def __init__(self): + def __init__(self, manager: 'Manager'): + self.manager = manager self.progress = Progress("[progress.description]{task.description}", BarColumn(bar_width=None), "[progress.percentage]{task.percentage:>3.2f}%", @@ -27,7 +31,7 @@ def __init__(self): async def get_progress(self) -> Panel: """Returns the progress bar""" - return Panel(self.progress_group, title="Files", border_style="green", padding=(1, 1)) + return Panel(self.progress_group, title=f"Config: {self.manager.config_manager.loaded_config}", border_style="green", padding=(1, 1)) async def update_total(self) -> None: """Updates the total number of files to be downloaded""" diff --git a/poetry.lock b/poetry.lock index 3135a8217..387ed695b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiofiles" @@ -838,13 +838,13 @@ xmp = ["defusedxml"] [[package]] name = "platformdirs" -version = "4.2.1" +version = "4.2.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" files = [ - {file = "platformdirs-4.2.1-py3-none-any.whl", hash = "sha256:17d5a1161b3fd67b390023cb2d3b026bbd40abde6fdb052dfbd3a29c3ba22ee1"}, - {file = "platformdirs-4.2.1.tar.gz", hash = "sha256:031cd18d4ec63ec53e82dceaac0417d218a6863f7745dfcc9efe7793b7039bdf"}, + {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, + {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, ] [package.extras] @@ -854,13 +854,13 @@ type = ["mypy (>=1.8)"] [[package]] name = "prompt-toolkit" -version = "3.0.43" +version = "3.0.45" description = "Library for building powerful interactive command lines in Python" optional = false python-versions = ">=3.7.0" files = [ - {file = "prompt_toolkit-3.0.43-py3-none-any.whl", hash = "sha256:a11a29cb3bf0a28a387fe5122cdb649816a957cd9261dcedf8c9f1fef33eacf6"}, - {file = "prompt_toolkit-3.0.43.tar.gz", hash = "sha256:3527b7af26106cbc65a040bcc84839a3566ec1b051bb0bfe953631e704b0ff7d"}, + {file = "prompt_toolkit-3.0.45-py3-none-any.whl", hash = "sha256:a29b89160e494e3ea8622b09fa5897610b437884dcdcd054fdc1308883326c2a"}, + {file = "prompt_toolkit-3.0.45.tar.gz", hash = "sha256:07c60ee4ab7b7e90824b61afa840c8f5aad2d46b3e2e10acc33d8ecc94a49089"}, ] [package.dependencies] @@ -1027,13 +1027,13 @@ files = [ [[package]] name = "requests" -version = "2.31.0" +version = "2.32.2" description = "Python HTTP for Humans." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, - {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, + {file = "requests-2.32.2-py3-none-any.whl", hash = "sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c"}, + {file = "requests-2.32.2.tar.gz", hash = "sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289"}, ] [package.dependencies] @@ -1102,13 +1102,13 @@ files = [ [[package]] name = "typing-extensions" -version = "4.11.0" +version = "4.12.0" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.11.0-py3-none-any.whl", hash = "sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a"}, - {file = "typing_extensions-4.11.0.tar.gz", hash = "sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0"}, + {file = "typing_extensions-4.12.0-py3-none-any.whl", hash = "sha256:b349c66bea9016ac22978d800cfff206d5f9816951f12a7d0ec5578b0a819594"}, + {file = "typing_extensions-4.12.0.tar.gz", hash = "sha256:8cbcdc8606ebcb0d95453ad7dc5065e6237b6aa230a31e81d0f440c30fed5fd8"}, ] [[package]] @@ -1264,4 +1264,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "2af1833513e71884ba5958fe2e8a8e68900ad2ebb7815956fe17c1bad85bfe2c" +content-hash = "60099cbc59be6b282cd53e906dc3f233a3719ce33a68fa485e6a549b56879694" diff --git a/pyproject.toml b/pyproject.toml index 1f2f4146a..a2e0bb0d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cyberdrop-dl" -version = "5.3.19" +version = "5.3.21" description = "Bulk downloader for multiple file hosts" authors = ["Jules Winnfield "] readme = "README.md" @@ -13,7 +13,7 @@ python = "^3.11" aiohttp = "^3.9.1" aiolimiter = "^1.1.0" inquirerpy = "^0.3.4" -platformdirs = "^4.2.0" +platformdirs = "^4.2.2" rich = "^13.7.0" pyyaml = "^6.0.1" certifi = "^2024.2.2"