Fix errors reported by mypy

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-10-13 12:45:51 +02:00
commit bfd0544ff8
13 changed files with 68 additions and 71 deletions

View file

@ -90,6 +90,10 @@ class Cmds: # export
slog(DEBUG, f'Adding top-level command {cmd} to parser')
self.__add_cmd_to_parser(cmd, subparsers)
# Run all sub-commands. Overwrite if you want to do anything before or after
async def _run(self, argv=None):
return await self.args.func(self.args)
async def __run(self, argv=None):
argcomplete.autocomplete(self.__parser)
self.args = self.__parser.parse_args(args=argv)
@ -115,7 +119,7 @@ class Cmds: # export
pr.enable()
try:
ret = await self.args.func(self.args)
ret = await self._run(self.args)
except Exception as e:
if hasattr(e, 'message'):
slog(ERR, e.message)