Add missing async keywords to jwutils.Cmd.run() reimplementations

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2020-02-10 19:49:46 +01:00
commit a5bf929f14

View file

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