mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-28 11:25:23 +02:00
cmds.distro.pkg.CmdMeta: Add class
Support distro pkg meta <package names ...>, returning meta information for the specified package names. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
f55d3045e0
commit
0317f46a01
4 changed files with 45 additions and 9 deletions
|
|
@ -1,11 +1,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import annotations
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import Iterable, TYPE_CHECKING
|
||||
|
||||
import abc
|
||||
from typing import Iterable
|
||||
|
||||
from ..lib.Package import Package
|
||||
from .Backend import Backend as Base
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
|
@ -16,9 +16,16 @@ class BePkg(Base):
|
|||
def __init__(self, parent: Parent):
|
||||
super().__init__(parent)
|
||||
|
||||
async def list_files(self, name: str) -> Iterable[str]:
|
||||
return await self._list_files(name)
|
||||
async def files(self, name: str) -> Iterable[str]:
|
||||
return await self._files(name)
|
||||
|
||||
@abc.abstractmethod
|
||||
async def _list_files(self, name: str) -> Iterable[str]:
|
||||
async def _files(self, name: str) -> Iterable[str]:
|
||||
pass
|
||||
|
||||
async def meta_data(self, names: Iterable[str]) -> Iterable[Package]:
|
||||
return await self._meta_data(names)
|
||||
|
||||
@abc.abstractmethod
|
||||
async def _meta_data(self, names: Iterable[str]) -> Iterable[Package]:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue