9 class TaskRunner(object):
10 def __init__(self, *args, **kwargs):
11 self.backend = ipfire.Backend(*args, **kwargs)
14 self.ioloop = tornado.ioloop.IOLoop.current()
16 def run_task(self, name, *args, **kwargs):
18 This method runs the task with the given name and
19 arguments asynchronically and exits the program in
20 case on a non-zero exit code
23 await self.backend.run_task(name, *args, **kwargs)
25 return self.ioloop.run_sync(task)
29 z = TaskRunner("@configsdir@/@PACKAGE_NAME@.conf")
32 sys.stderr.write("Argument needed\n")
35 # Parse command line arguments
36 args = tornado.options.parse_command_line()