def kickstart(request, path): config = build_config(path, request) verb = request.GET['verb'] verb = verb.split(',') email = request.GET.get('email') client.ensure_daemon() executor = client.get_server() for v in verb: if email: config = main.process('allplots', config, executor=executor) build_email(request, path, config) elif v == 'parse': # we've already parsed in `build_config` above. pass else: # main.process handles the rest of the verbs, or errors config = main.process(v, config, executor=executor) return HttpResponse( json.dumps(sanitize_config_for_client(config)), content_type="application/json")
def start_daemon(request): client.ensure_daemon() if tqdaemon.status(): messages.info(request, "Daemon started successfully.") else: messages.error(request, "Daemon failed to start.")