示例#1
0
文件: web.py 项目: joamatab/Frodo
def qstat_html(jobID=None, qusername=None):
    if "username" not in session:
        return redirect(url_for("login"))
    username = session["username"]
    password = session["password"]
    now = time.asctime()
    result = qstat.exec_qstat(username, password, qstat_username=qusername)
    if result.startswith("Error"):
        return render_template("error.html", msg=result)
    result = qstat.parse_qstat1(result)
    fields = result["fields"]
    records = result["records"]
    summary = qstat.summarize1(fields, records)
    if jobID:
        job_details = qstat.parse_qstat_jobID(
            qstat.exec_qstat(username, password, jobID=jobID))
    else:
        job_details = None
    return render_template(
        "qstat.html",
        username=username,
        time=now,
        summary=summary,
        fields=fields,
        records=records,
        job=job_details,
    )
示例#2
0
文件: web.py 项目: yoavram/Frodo
def qstat_json():
    if 'username' not in session:
        return {'error':'please login','url':url_for('login')}
    username = session['username']
    password = session['password']
    now = time.asctime()
    qstat_result = qstat.parse_qstat1(qstat.exec_qstat(username, password))
    qstat_result.update(qstat.summarize1(qstat_result['fields'],qstat_result['records']))
    qstat_result['time'] = now
    return jsonify(**qstat_result)
示例#3
0
文件: web.py 项目: joamatab/Frodo
def qstat_json():
    if "username" not in session:
        return {"error": "please login", "url": url_for("login")}
    username = session["username"]
    password = session["password"]
    now = time.asctime()
    qstat_result = qstat.parse_qstat1(qstat.exec_qstat(username, password))
    qstat_result.update(
        qstat.summarize1(qstat_result["fields"], qstat_result["records"]))
    qstat_result["time"] = now
    return jsonify(**qstat_result)
示例#4
0
def qstat_json():
    if 'username' not in session:
        return {'error': 'please login', 'url': url_for('login')}
    username = session['username']
    password = session['password']
    now = time.asctime()
    qstat_result = qstat.parse_qstat1(qstat.exec_qstat(username, password))
    qstat_result.update(
        qstat.summarize1(qstat_result['fields'], qstat_result['records']))
    qstat_result['time'] = now
    return jsonify(**qstat_result)
示例#5
0
文件: web.py 项目: yoavram/Frodo
def qstat_html(jobID = None, qusername=None):
    if 'username' not in session:
        return redirect(url_for('login'))
    username = session['username']
    password = session['password']
    now = time.asctime()
    result = qstat.exec_qstat(username, password, qstat_username=qusername)
    if result.startswith("Error"):
        return render_template("error.html", msg=result)
    result = qstat.parse_qstat1(result)
    fields = result['fields']
    records = result['records']
    summary = qstat.summarize1(fields,records)
    if jobID:
        job_details = qstat.parse_qstat_jobID(qstat.exec_qstat(username, password, jobID=jobID))
    else:
        job_details = None
    return render_template("qstat.html", username=username, time=now, summary=summary, fields=fields, records=records, job=job_details)