Example #1
0
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,
    )
Example #2
0
File: web.py Project: 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)
Example #3
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)
Example #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)
Example #5
0
File: web.py Project: 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)