예제 #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)