diff --git a/scripts/process-text-files.py b/scripts/process-text-files.py index 90b4d85..4f1aab2 100644 --- a/scripts/process-text-files.py +++ b/scripts/process-text-files.py @@ -354,7 +354,7 @@ class Cmd(jwutils.Cmd): #slog(NOTICE, "replacements =", self.replacements) # overriding - def run(self, args): + async def run(self, args): self._init(args) files = [] if args.name_regex is not None: @@ -461,7 +461,7 @@ class CmdCppReplaceSymbols(Cmd): return p # overriding - def run(self, args): + async def run(self, args): if args.name_regex is not None: return super(CmdCppReplaceSymbols, self).run(args) self._init(args) @@ -547,7 +547,7 @@ class CmdCppAddNamespace(Cmd): return p # overriding - def run(self, args): + async def run(self, args): if args.name_regex is not None: return super(CmdCppAddNamespace, self).run(args) self._init(args) diff --git a/scripts/trim-src.py b/scripts/trim-src.py index 8b7f234..2192a05 100644 --- a/scripts/trim-src.py +++ b/scripts/trim-src.py @@ -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: diff --git a/tools/python/jwutils/Cmd.py b/tools/python/jwutils/Cmd.py index ae88910..86d2ada 100644 --- a/tools/python/jwutils/Cmd.py +++ b/tools/python/jwutils/Cmd.py @@ -7,14 +7,14 @@ ABC = abc.ABCMeta('ABC', (object,), {'__slots__': ()}) class Cmd(ABC): # export @abc.abstractmethod - def run(self, args): + async def run(self, args): pass def __init__(self, name, help): self.name = name self.help = help - def _run(self, args): + async def _run(self, args): pass def add_parser(self, parsers): diff --git a/tools/python/jwutils/Cmds.py b/tools/python/jwutils/Cmds.py index 56ef93b..7e1ff51 100644 --- a/tools/python/jwutils/Cmds.py +++ b/tools/python/jwutils/Cmds.py @@ -39,7 +39,7 @@ class Cmds: # export cmd.add_parser(subparsers) async def __run(self): - #def __run(self): + #async def __run(self): args = self.__parser.parse_args() jwutils.log.set_level(args.log_level) jwutils.log.set_flags(args.log_flags)