def main(): parser = ArgumentParser() parser.add_argument("-n", "--host", default="127.0.0.1", help="network hostname") args = parser.parse_args() params = dict(hostname=args.host) try: open("users.pickle") except IOError: common.make_users("users.pickle", 100) with open("webui/barker_host.js", "wb") as jsfile: jsfile.write("""barker_host = "%(hostname)s";\n""" % params) pids = [] try: for command in (commands % params).split("\n"): if command and not command.strip().startswith("#"): pids.append(launch(command.strip())) while True: sleep(100000) finally: for pid in pids: os.kill(pid, signal.SIGTERM)
def main(): parser = ArgumentParser() parser.add_argument("-n", "--host", default="127.0.0.1", help="network hostname") parser.add_argument("--webui-only", default=False, action="store_true", help="start only webui helpers") parser.add_argument("--webui-proxy", default="webui/proxy/proxy.js", help="location of the proxy") args = parser.parse_args() params = dict(hostname=args.host, webui_proxy=args.webui_proxy) try: open("users.pickle") except IOError: common.make_users("users.pickle", 100) with open("webui/barker_host.js", "wb") as jsfile: jsfile.write("""barker_host = "%(hostname)s";\n""" % params) pids = [] try: for command in (commands % params).split("\n"): if command and not command.strip().startswith("#") and (command.strip().startswith(args.webui_proxy) or not args.webui_only): pids.append(launch(command.strip())) while True: sleep(100000) finally: for pid in pids: os.kill(pid, signal.SIGTERM)
def main(): try: open("users.pickle") except IOError: common.make_users("users.pickle", 100) for command in commands.split("\n"): if command and not command.strip().startswith("#"): launch(command.strip()) try: sleep(100000) finally: for pid in pids: os.kill(pid, signal.SIGTERM)
def main(): parser = ArgumentParser() parser.add_argument("-n", "--host", default="127.0.0.1", help="network hostname") parser.add_argument("--webui-only", default=False, action="store_true", help="start only webui helpers") parser.add_argument("--webui-proxy", default="webui/proxy/proxy.js", help="location of the proxy") args = parser.parse_args() params = dict(hostname=args.host, webui_proxy=args.webui_proxy) try: open("users.pickle") except IOError: common.make_users("users.pickle", 100) with open("webui/barker_host.js", "wb") as jsfile: jsfile.write("""barker_host = "%(hostname)s";\n""" % params) pids = [] try: for command in (commands % params).split("\n"): if command and not command.strip().startswith("#") and ( command.strip().startswith(args.webui_proxy) or not args.webui_only): pids.append(launch(command.strip())) while True: sleep(100000) finally: for pid in pids: os.kill(pid, signal.SIGTERM)