Fix errors reported by mypy

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-11-02 09:42:21 +01:00
commit d8d514a4d1
3 changed files with 4 additions and 3 deletions

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import List, Type, Union, TypeVar
from typing import Optional, List, Type, Union, TypeVar
import inspect, sys, re, abc, argparse
from argparse import ArgumentParser, _SubParsersAction
@ -17,6 +17,7 @@ class Cmd(abc.ABC): # export
pass
def __init__(self, name: str, help: str) -> None:
from . import Cmds
self.name = name
self.help = help
self.parent = None

View file

@ -47,7 +47,7 @@ class Options: # export
slog(ERR, 'Failed to split options string >{}<'.format(opts_str))
raise
for opt_str in opt_strs:
opt_str = re.sub('\s*=\s*', '=', opt_str)
opt_str = re.sub(r'\s*=\s*', '=', opt_str)
sides = opt_str.split('=')
lhs = sides[0].strip()
if not len(lhs):

View file

@ -99,7 +99,7 @@ class ShellCmd: # export
if __name__ == '__main__':
import jwutils.log
jwutils.log.set_level(INFO)
jwutils.log.set_level('info')
async def run():
sp = ShellCmd([ 'echo', 'hello world!' ])
await sp.run()