jw-pkg/src/python/jw/pkg/cmds/secrets/Cmd.py
Jan Lindemann 5ad65f85fd cmds.secrets.lib.util: Add module
To be able to use secret handling code from other modules, move the
bulk of it from the "secrets"-command centric implementation in
cmds.secrets.Cmd into a new module cmds.secrets.lib.util.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-11 14:56:21 +02:00

41 lines
1.6 KiB
Python

# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import TYPE_CHECKING
from ..Cmd import Cmd as Base
if TYPE_CHECKING:
from typing import Iterable
from ...lib.Distro import Distro
from ..CmdDistro import CmdDistro
from .lib.util import *
class Cmd(Base): # export
async def _match_files(self, packages: Iterable[str], pattern: str) -> list[str]:
return await match_files(self.distro, packages, pattern)
async def _list_template_files(self, packages: Iterable[str]) -> list[str]:
return await list_template_files(self.distro, packages)
async def _list_secret_paths(self, packages: Iterable[str], ignore_missing: bool=False) -> list[str]:
return await list_secret_paths(self.distro, packages, ignore_missing)
async def _list_compilation_targets(self, packages: Iterable[str], ignore_missing: bool=False) -> list[str]:
return await list_compilation_targets(self.distro, packages, ignore_missing)
async def _remove_compilation_targets(self, packages: Iterable[str]) -> list[str]:
return await remove_compilation_targets(self.distro, packages)
async def _compile_template_files(self, packages: Iterable[str], default_attrs: Attrs) -> list[str]:
return await compile_template_files(self.distro, packages, default_attrs)
def __init__(self, parent: CmdDistro, name: str, help: str) -> None:
super().__init__(parent, name, help)
def add_arguments(self, parser: ArgumentParser) -> None:
super().add_arguments(parser)
parser.add_argument("packages", nargs='*', help="Package names")