From 4e1ec7eaf600c23ca50f45700a2d8f764e23b963 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 21 Apr 2026 11:29:19 +0200 Subject: [PATCH] lib.Distro._select() -> _select_by_name() Rename ._select() to _select_by_name() in Distro and its subclasses. Don't rename .select() itself, because it's going to be a broader interface supporting more select criteria than just package names. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/Distro.py | 4 ++-- src/python/jw/pkg/lib/distros/arch/Distro.py | 2 +- src/python/jw/pkg/lib/distros/debian/Distro.py | 2 +- src/python/jw/pkg/lib/distros/suse/Distro.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/python/jw/pkg/lib/Distro.py b/src/python/jw/pkg/lib/Distro.py index 1e0058a2..35cfe602 100644 --- a/src/python/jw/pkg/lib/Distro.py +++ b/src/python/jw/pkg/lib/Distro.py @@ -323,11 +323,11 @@ class Distro(abc.ABC): # -- select @abc.abstractmethod - async def _select(self, names: Iterable[str]) -> Iterable[Package]: + async def _select_by_name(self, names: Iterable[str]) -> Iterable[Package]: pass async def select(self, names: Iterable[str] = []) -> Iterable[Package]: - return await self._select(names) + return await self._select_by_name(names) # -- install diff --git a/src/python/jw/pkg/lib/distros/arch/Distro.py b/src/python/jw/pkg/lib/distros/arch/Distro.py index 25072b8a..df7adfbb 100644 --- a/src/python/jw/pkg/lib/distros/arch/Distro.py +++ b/src/python/jw/pkg/lib/distros/arch/Distro.py @@ -36,7 +36,7 @@ class Distro(Base): async def _reboot_required(self, verbose: bool) -> bool: raise NotImplementedError('distro reboot-required is not yet implemented for Arch-like distributions') - async def _select(self, names: Iterable[str]) -> Iterable[Package]: + async def _select_by_name(self, names: Iterable[str]) -> Iterable[Package]: raise NotImplementedError('distro select is not yet implemented for Arch-like distributions') async def _install(self, names: Iterable[str], only_update: bool) -> None: diff --git a/src/python/jw/pkg/lib/distros/debian/Distro.py b/src/python/jw/pkg/lib/distros/debian/Distro.py index d0dd3fef..3cb794cc 100644 --- a/src/python/jw/pkg/lib/distros/debian/Distro.py +++ b/src/python/jw/pkg/lib/distros/debian/Distro.py @@ -59,7 +59,7 @@ class Distro(Base): log(NOTICE, f'No. {reboot_required} doesn\'t exist.') return False - async def _select(self, names: Iterable[str]) -> Iterable[Package]: + async def _select_by_name(self, names: Iterable[str]) -> Iterable[Package]: return await query_packages(names, ec=self.ctx) async def _install(self, names: Iterable[str], only_update: bool) -> None: diff --git a/src/python/jw/pkg/lib/distros/suse/Distro.py b/src/python/jw/pkg/lib/distros/suse/Distro.py index 122bb7e1..de881a03 100644 --- a/src/python/jw/pkg/lib/distros/suse/Distro.py +++ b/src/python/jw/pkg/lib/distros/suse/Distro.py @@ -48,7 +48,7 @@ class Distro(Base): return True return False - async def _select(self, names: Iterable[str]) -> Iterable[Package]: + async def _select_by_name(self, names: Iterable[str]) -> Iterable[Package]: return await query_packages(names, ec=self.ctx) async def _install(self, names: Iterable[str], only_update: bool) -> None: