mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
jw.pkg.cmds.lib.Cmd: Define run()
Define run(), which calls _run() in the abstract base class Cmd, not in lib.Cmd. Otherwise lib.Cmd is not abstract, which will predictably confuse including code outside of jw-pkg. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
4932c6816c
commit
d50a33d9ab
2 changed files with 4 additions and 4 deletions
|
|
@ -20,6 +20,3 @@ class Cmd(Base): # export
|
||||||
type_name_filter=r'Cmd[^.]'
|
type_name_filter=r'Cmd[^.]'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
async def run(self, args):
|
|
||||||
return await self._run(args)
|
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,11 @@ class Cmd(abc.ABC): # export
|
||||||
def child_classes(self) -> list[type[Cmd]]:
|
def child_classes(self) -> list[type[Cmd]]:
|
||||||
return tuple(self.__child_classes)
|
return tuple(self.__child_classes)
|
||||||
|
|
||||||
@abc.abstractmethod
|
|
||||||
async def run(self, args):
|
async def run(self, args):
|
||||||
|
return await self._run(args)
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
|
async def _run(self, args):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def add_subcommands(self, cmds: Cmd|list[Cmds]|Types|list[Types]) -> None:
|
def add_subcommands(self, cmds: Cmd|list[Cmds]|Types|list[Types]) -> None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue