mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
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:
parent
4e2b15e586
commit
4e1ec7eaf6
4 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue