Consistently replace def run() by async def run()

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2019-12-20 08:41:58 +01:00
commit a85f0929c6
4 changed files with 9 additions and 9 deletions

View file

@ -15,7 +15,7 @@ class TrimSourceCmd(jwutils.Cmd):
super(TrimSourceCmd, self).__init__(name, help=help)
@abstractmethod
def _run(self, args, mime, path, contents):
async def _run(self, args, mime, path, contents):
raise Exception("_run() method not implemented")
def add_parser(self, parsers):
@ -23,7 +23,7 @@ class TrimSourceCmd(jwutils.Cmd):
p.add_argument("input", help="input files", nargs='+')
return p
def run(self, args):
async def run(self, args):
ms = magic.open(magic.NONE)
ms.load()
for path in args.input:
@ -72,7 +72,7 @@ class CmdBeautify(TrimSourceCmd):
r += line.rstrip() + '\n'
return r
def _run(self, args, mime, path, contents):
async def _run(self, args, mime, path, contents):
slog(NOTICE, "formatting", path, "of type", mime)
method = getattr(self, '_process' + ''.join(s.capitalize() for s in re.split('[/-]', mime)))
if method is None: