mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-28 14:05:25 +02:00
jw.pkg.cmds.distro.CmdSelect: Add command
Add the sub-command select to jw-pkg.py distro, along with an Implementation for OpenSUSE. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
81833e049a
commit
3ceb2b71b7
3 changed files with 74 additions and 0 deletions
26
src/python/jw/pkg/cmds/distro/backend/BeSelect.py
Normal file
26
src/python/jw/pkg/cmds/distro/backend/BeSelect.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import annotations
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import abc
|
||||
from typing import Iterable
|
||||
|
||||
from .Backend import Backend as Base
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..CmdSelect import CmdSelect as Parent
|
||||
from .Package import Package
|
||||
|
||||
class BeSelect(Base):
|
||||
|
||||
def __init__(self, parent: Parent):
|
||||
super().__init__(parent)
|
||||
|
||||
@property
|
||||
async def all_installed_packages(self) -> Iterable[Package]:
|
||||
return await self._all_installed_packages()
|
||||
|
||||
@abc.abstractmethod
|
||||
async def _all_installed_packages(self) -> Iterable[Package]:
|
||||
pass
|
||||
17
src/python/jw/pkg/cmds/distro/backend/suse/Select.py
Normal file
17
src/python/jw/pkg/cmds/distro/backend/suse/Select.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from typing import Iterable
|
||||
from argparse import Namespace
|
||||
|
||||
from ...lib.Package import Package
|
||||
from ...lib.rpm import all_installed_packages
|
||||
from ...Cmd import Cmd
|
||||
from ..BeSelect import BeSelect as Base
|
||||
|
||||
class Select(Base):
|
||||
|
||||
def __init__(self, parent: Cmd):
|
||||
super().__init__(parent)
|
||||
|
||||
async def _all_installed_packages(self) -> Iterable[Package]:
|
||||
return await all_installed_packages()
|
||||
Loading…
Add table
Add a link
Reference in a new issue