mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
cmds.projects.BaseCmdPkgRelations: Add type hints
Add type hints to the class's methods. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
57f204ccaa
commit
5f81f8d4da
1 changed files with 5 additions and 4 deletions
|
|
@ -9,7 +9,7 @@ from ..CmdProjects import CmdProjects
|
||||||
|
|
||||||
class BaseCmdPkgRelations(Cmd):
|
class BaseCmdPkgRelations(Cmd):
|
||||||
|
|
||||||
def pkg_relations(self, rel_type, args):
|
def pkg_relations(self, rel_type: str, args: Namespace) -> list[str]:
|
||||||
|
|
||||||
if args.subsections is None:
|
if args.subsections is None:
|
||||||
subsecs = self.app.os_cascade()
|
subsecs = self.app.os_cascade()
|
||||||
|
|
@ -22,6 +22,7 @@ class BaseCmdPkgRelations(Cmd):
|
||||||
expand_semver_revision_range = args.expand_semver_revision_range
|
expand_semver_revision_range = args.expand_semver_revision_range
|
||||||
if args.syntax == 'debian':
|
if args.syntax == 'debian':
|
||||||
expand_semver_revision_range = True
|
expand_semver_revision_range = True
|
||||||
|
|
||||||
log(DEBUG, f'flavour="{args.flavour}", subsecs="{", ".join(subsecs)}", "ignore="{args.ignore}"')
|
log(DEBUG, f'flavour="{args.flavour}", subsecs="{", ".join(subsecs)}", "ignore="{args.ignore}"')
|
||||||
|
|
||||||
version_pattern = re.compile("[0-9-.]*")
|
version_pattern = re.compile("[0-9-.]*")
|
||||||
|
|
@ -110,10 +111,10 @@ class BaseCmdPkgRelations(Cmd):
|
||||||
if not dep_str in r:
|
if not dep_str in r:
|
||||||
log(DEBUG, f'Appending dependency "{dep_str}"')
|
log(DEBUG, f'Appending dependency "{dep_str}"')
|
||||||
r.append(dep_str)
|
r.append(dep_str)
|
||||||
return args.delimiter.join(r)
|
return r
|
||||||
|
|
||||||
def print_pkg_relations(self, rel_type, args_):
|
def print_pkg_relations(self, rel_type: str, args: Namespace) -> None:
|
||||||
print(self.pkg_relations(rel_type, args_))
|
print(self.pkg_relations(rel_type, args))
|
||||||
|
|
||||||
def __init__(self, parent: CmdProjects, relation: str, help: str) -> None:
|
def __init__(self, parent: CmdProjects, relation: str, help: str) -> None:
|
||||||
super().__init__(parent, 'pkg-' + relation, help=help)
|
super().__init__(parent, 'pkg-' + relation, help=help)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue