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:
Jan Lindemann 2026-02-17 13:37:33 +01:00
commit 3ceb2b71b7
3 changed files with 74 additions and 0 deletions

View 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

View 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()