Skip to content

Bulk asynchronous downloader for multiple file hosts

refactor: include AppData in system report

NTFSvolumedabb8970e32d
diff --git a/cyberdrop_dl/commands/report.py b/cyberdrop_dl/commands/report.py
index c1b945efd..4ec76079b 100644
--- a/cyberdrop_dl/commands/report.py
+++ b/cyberdrop_dl/commands/report.py
@@ -2,33 +2,40 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any
-from cyberdrop_dl import ALL_DEPENDENCIES, __version__, ffmpeg
-from cyberdrop_dl.utils import get_system_information
-from cyberdrop_dl.utils.markdown import Row, markdown_table
-
if TYPE_CHECKING:
from collections.abc import Generator, Iterable, Sequence
+ from cyberdrop_dl.utils.markdown import Row
+
def _unpack(data: Iterable[tuple[str, Any]]) -> Generator[tuple[str, str]]:
- for name, value in data:
+ for name, value in sorted(data, key=lambda x: str(x[0]).casefold()):
yield name, str(value)
-def _table(title: str, headers: Sequence[str], rows: Iterable[Row]) -> str:
- return f"## {title}\n\n" + markdown_table(headers, *rows) + "\n"
+def _table(title: str | None, headers: Sequence[str], rows: Iterable[Row]) -> str:
+ from cyberdrop_dl.utils.markdown import markdown_table
+
+ title = f"## {title}\n\n" if title else ""
+ return title + markdown_table(headers, *rows) + "\n"
def generate_report() -> str:
+ from cyberdrop_dl import ALL_DEPENDENCIES, __version__, ffmpeg
+ from cyberdrop_dl.__main__ import __file__ as entrypoint
+ from cyberdrop_dl.config.appdata import AppData
+ from cyberdrop_dl.utils import get_system_information
+
return "\n".join(
[
+ "\n# System Report\n",
_table(
- "Version",
- ["Name", "Value"],
+ "",
+ ["Program", "Version", "Location"],
[
- ("cyberdrop-dl", __version__),
- ("ffmpeg", str(ffmpeg.version())),
- ("ffprobe", str(ffmpeg.ffprobe_version())),
+ ("cyberdrop-dl", __version__, str(entrypoint)),
+ ("ffmpeg", str(ffmpeg.version()), str(ffmpeg.which_ffmpeg())),
+ ("ffprobe", str(ffmpeg.ffprobe_version()), str(ffmpeg.which_ffprobe())),
],
),
_table(
@@ -36,10 +43,15 @@ def generate_report() -> str:
["Name", "Value"],
_unpack(get_system_information().items()),
),
+ _table(
+ "AppData",
+ ["Name", "Default location"],
+ _unpack(AppData.default()),
+ ),
_table(
"Dependencies",
["Package", "Version"],
- _unpack(sorted(ALL_DEPENDENCIES.items())),
+ _unpack(ALL_DEPENDENCIES.items()),
),
]
)
diff --git a/pyproject.toml b/pyproject.toml
index a26b4656d..caf5ee1af 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -88,6 +88,7 @@ dev = [
[tool.basedpyright]
include = ["cyberdrop_dl", "scripts", "tests"]
+reportAny = "information"
reportExplicitAny = false
reportImplicitAbstractClass = false
reportImplicitOverride = "hint"
diff --git a/tox.ini b/tox.ini
index a06f5d47d..9d8fc89af 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,6 +2,7 @@
envlist = py312, py313, py314
[testenv]
+allowlist_externals = uv
commands_pre =
uv sync --all-extras
commands =