mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 09:35:54 +02:00
cmds.distro: Move all modules to lib
Functions abstracting the distribution are not only needed in the context of the distro subcommand, but also by other code, so make the bulk of the code abstracting the distribution available in some place more universally useful than below cmds.distro. This commit leaves the source files mostly unchanged. They are only patched to fix import paths, so that functionality is preserved. Refactoring the code from command-line API to library API will be done by the next commit. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
f94a2ac037
commit
7e7cee6d11
45 changed files with 44 additions and 42 deletions
31
src/python/jw/pkg/lib/distros/BePkg.py
Normal file
31
src/python/jw/pkg/lib/distros/BePkg.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import annotations
|
||||
from typing import Iterable, TYPE_CHECKING
|
||||
|
||||
import abc
|
||||
|
||||
from ..Package import Package
|
||||
from .Backend import Backend as Base
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..Cmd import Cmd as Parent
|
||||
|
||||
class BePkg(Base):
|
||||
|
||||
def __init__(self, parent: Parent):
|
||||
super().__init__(parent)
|
||||
|
||||
async def files(self, name: str) -> Iterable[str]:
|
||||
return await self._files(name)
|
||||
|
||||
@abc.abstractmethod
|
||||
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