From 31aae57b2d4a38c92bf4c470ff2b2c6c31c99a9d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 27 Aug 2026 18:03:20 -0500 Subject: [PATCH] Trim docstrings and comments --- esphome/framework_helpers.py | 12 ++++-------- esphome/platformio/registry.py | 14 +++++--------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/esphome/framework_helpers.py b/esphome/framework_helpers.py index 621d6d8546..037cdf7a8c 100644 --- a/esphome/framework_helpers.py +++ b/esphome/framework_helpers.py @@ -320,8 +320,7 @@ def _tar_extract_all( data: File-like object containing the TAR archive extract_dir: Directory to extract contents to progress_header: If set, show a progress bar with this header - progress: If set, receives fractions in [0, 1] ending at 1.0 and - overrides ``progress_header`` + progress: fraction callback (0..1, ends at 1.0); overrides progress_header """ import tarfile @@ -402,8 +401,7 @@ def _zip_extract_all( data: File-like object containing the ZIP archive extract_dir: Directory to extract contents to progress_header: If set, show a progress bar with this header - progress: If set, receives fractions in [0, 1] ending at 1.0 and - overrides ``progress_header`` + progress: fraction callback (0..1, ends at 1.0); overrides progress_header """ import zipfile @@ -502,8 +500,7 @@ def _7z_extract_all( data: File-like object containing the 7z archive (must be seekable) extract_dir: Directory to extract contents to progress_header: If set, show a progress bar with this header - progress: If set, called with 1.0 on completion and overrides - ``progress_header`` + progress: called with 1.0 on completion; overrides progress_header """ import py7zr @@ -590,8 +587,7 @@ def archive_extract_all( archive: Path to archive file or file-like object extract_dir: Directory to extract contents to progress_header: If set, show a progress bar with this header - progress: If set, receives fractions in [0, 1] ending at 1.0 and - overrides ``progress_header`` + progress: fraction callback (0..1, ends at 1.0); overrides progress_header Raises: TypeError: If archive is not a valid type diff --git a/esphome/platformio/registry.py b/esphome/platformio/registry.py index aaf374bd67..11f7c49c44 100644 --- a/esphome/platformio/registry.py +++ b/esphome/platformio/registry.py @@ -304,9 +304,8 @@ def install_package( # Persistent location so an interrupted download resumes across runs. downloads_dir.mkdir(parents=True, exist_ok=True) archive = _archive_path(downloads_dir, name, version) - # The batch header already names each package; a batched archive that - # unexpectedly needs a real download keeps the INFO line, since the - # shared bar shows no progress for it + # Batch header names each package; keep INFO when an archive + # unexpectedly needs a real download (the shared bar won't move) log = ( _LOGGER.debug if extract_progress is not None and archive.is_file() @@ -346,12 +345,9 @@ def install_package( def install_packages(specs: Collection[PackageSpec], downloads_dir: Path) -> None: - """Install several packages, extracting verified archives in parallel. - - Prefetched archives extract concurrently under one shared bar; the rest - (marker hits, mirror overrides, missing archives) take the sequential - ``install_package`` path. The first failure is re-raised. - """ + """Install several packages; prefetched archives extract in parallel under + one shared bar, the rest take the sequential ``install_package`` path. + The first failure is re-raised.""" pending: list[tuple[PackageSpec, int]] = [] rest: list[PackageSpec] = [] seen: set[str] = set()