Skip to content
This repository has been archived by the owner on Jan 25, 2018. It is now read-only.

Fixes #15 #17

Merged
merged 1 commit into from
Oct 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion JobStatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def update_status(batch_array_id, job_id, task_id, status, host_name):
except OperationalError as e:
traceback.print_exc()
else:
raise
#
# After 10 tries, return a command that will fail
#
return "test"

if __name__ == "__main__":
import cgitb
Expand Down
57 changes: 34 additions & 23 deletions ViewBatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,34 +594,23 @@ def build_job_table_body(self):
self.text(str(task.batch_array_task.task_id))
if status == RunBatch.JS_DONE:
with self.tag("td"):
with self.tag("div", **{
"class":"success_message"}):
cpu = task.get_runtime()
self.text("Complete (%.2f sec)" % cpu)
cpu = task.get_runtime()
if cpu is not None:
with self.tag("div", **{
"class":"success_message"}):
self.text("Complete (%.2f sec)" % cpu)
else:
with self.tag("div", **{
"class":"error_message"}):
self.text("Error: see log")
with self.tag("div"):
self.build_resubmit_run_form(run)
else:
with self.tag("td", style='color:red'):
with self.tag("div"):
self.text(status.lower().capitalize())
with self.tag("div"):
with self.tag("form",
action="ViewBatch.py",
method="POST",
target="ResubmitWindow"):
self.doc.input(
type="hidden", name=BATCH_ID)
self.doc.input(
type="hidden",
name=RUN_ID,
value=str(run.run_id))
self.doc.input(
type="hidden",
name=SUBMIT_RUN,
value=RunBatch.JS_ONE)
self.doc.stag(
"input",
type='submit',
name="Resubmit_Button",
value=RESUBMIT)
self.build_resubmit_run_form(run)
self.build_text_file_table_cell(task)
if self.my_batch.wants_measurements_file:
with self.tag("td"):
Expand Down Expand Up @@ -658,6 +647,28 @@ def build_job_table_body(self):
title='Delete file %s' % filename,
onclick='return confirm("Do you really want'
'to delete %s?")' % filename)

def build_resubmit_run_form(self, run):
with self.tag("form",
action="ViewBatch.py",
method="POST",
target="ResubmitWindow"):
self.doc.input(
type="hidden", name=BATCH_ID)
self.doc.input(
type="hidden",
name=RUN_ID,
value=str(run.run_id))
self.doc.input(
type="hidden",
name=SUBMIT_RUN,
value=RunBatch.JS_ONE)
self.doc.stag(
"input",
type='submit',
name="Resubmit_Button",
value=RESUBMIT)

def build_footer(self):
'''Build the footer for scrolling through the pages'''
page_size = BATCHPROFILER_DEFAULTS[PAGE_SIZE] or 25
Expand Down