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 <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-21 11:29:19 +02:00
commit 4e1ec7eaf6
Signed by: jan
GPG key ID: 3750640C9E25DD61
4 changed files with 5 additions and 5 deletions

View file

@ -323,11 +323,11 @@ class Distro(abc.ABC):
# -- select # -- select
@abc.abstractmethod @abc.abstractmethod
async def _select(self, names: Iterable[str]) -> Iterable[Package]: async def _select_by_name(self, names: Iterable[str]) -> Iterable[Package]:
pass pass
async def select(self, names: Iterable[str] = []) -> Iterable[Package]: async def select(self, names: Iterable[str] = []) -> Iterable[Package]:
return await self._select(names) return await self._select_by_name(names)
# -- install # -- install

View file

@ -36,7 +36,7 @@ class Distro(Base):
async def _reboot_required(self, verbose: bool) -> bool: async def _reboot_required(self, verbose: bool) -> bool:
raise NotImplementedError('distro reboot-required is not yet implemented for Arch-like distributions') 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') raise NotImplementedError('distro select is not yet implemented for Arch-like distributions')
async def _install(self, names: Iterable[str], only_update: bool) -> None: async def _install(self, names: Iterable[str], only_update: bool) -> None:

View file

@ -59,7 +59,7 @@ class Distro(Base):
log(NOTICE, f'No. {reboot_required} doesn\'t exist.') log(NOTICE, f'No. {reboot_required} doesn\'t exist.')
return False 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) return await query_packages(names, ec=self.ctx)
async def _install(self, names: Iterable[str], only_update: bool) -> None: async def _install(self, names: Iterable[str], only_update: bool) -> None:

View file

@ -48,7 +48,7 @@ class Distro(Base):
return True return True
return False 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) return await query_packages(names, ec=self.ctx)
async def _install(self, names: Iterable[str], only_update: bool) -> None: async def _install(self, names: Iterable[str], only_update: bool) -> None: