def view_job(self, address, job_id): """ display list of jobs self.num_resubmits = 0 self.cause_of_death = "" self.jobid = -1 self.host_name = "" self.timestamp = None self.heart_beat = None self.exception = None """ job = send_zmq_msg(job_id, "get_job", "", address) out_html = "" details = job_to_html(job) out_html += details return out_html
def list_jobs(self, address): """ display list of jobs self.num_resubmits = 0 self.cause_of_death = "" self.jobid = -1 self.host_name = "" self.timestamp = None self.heart_beat = None self.exception = None """ job_id = -1 self.jobs = send_zmq_msg(job_id, "get_jobs", "", address) out_html = ''' <form action="list_jobs" method="GET"> Address of pythongrid session: <br /> <input type="text" name="address" /><br /><br /> <input type="submit" /><br><br><br> </form> <form action="view_job" method="GET"> <table border="1"> <tr><td>sge job id</td><td>job done</td><td>cause of death</td><tr> ''' for job in self.jobs: out_html += "<tr><td><a href='/view_job?address=%s&job_id=%s'>%s</td>" % (address, str(job.name), str(job.jobid)) out_html += "<td>%s</td>" % (str(job.ret!=None)) out_html += "<td>%s</td>" % (job.cause_of_death) out_html += "</tr>" out_html += "</table></form>" return out_html