def addversion(): req_arg = request.form.to_dict() hosts = req_arg.pop('hosts', zw.children.values()) if isinstance(hosts, str): hosts = hosts.split(',') return jsonify( json_call(hosts, 'addversion.json', 'POST', req_arg, request.files))
def schedule(): req_arg = request.form.to_dict() hosts = req_arg.pop('hosts', zw.children.values()) if isinstance(hosts, str): hosts = hosts.split(',') scrapyd_utils.version_check(hosts, req_arg['project']) return jsonify(json_call(hosts, 'schedule.json', 'POST', req_arg))
def listjobs(): req_arg = request.form.to_dict() hosts = req_arg.pop('hosts', zw.children.values()) if isinstance(hosts, str): hosts = hosts.split(',') return jsonify(json_call(hosts, 'listjobs.json', 'GET', req_arg))
def delproject(): req_arg = request.form.to_dict() hosts = req_arg.pop('hosts', zw.children.values()) if isinstance(hosts, str): hosts = hosts.split(',') return jsonify(json_call(hosts, 'delproject.json', 'POST', req_arg))