diff --git a/atdb/taskdatabase/services/algorithms.py b/atdb/taskdatabase/services/algorithms.py index c822d3ca3e8b37bcf675e1fe89cc144140f9a050..c1685b2352fede66f21bcea39a08386002e50f50 100644 --- a/atdb/taskdatabase/services/algorithms.py +++ b/atdb/taskdatabase/services/algorithms.py @@ -39,25 +39,23 @@ def get_size(status_list): def convert_logentries_to_html(log_entries): results = "" - try: - results += "<th>service</th><th>status</th><th>timestamp</th><th>cpu_cycles</th><th>wall_clock_time</th><th>logfile</th>" - results += "<tbody>" - for log in log_entries: - line = "<tr><td><b>" + log.step_name + '</b></td>' - line +='<td class="' + log.status + '" >' + log.status + "</td>" - line += "<td>" + str(log.timestamp.strftime("%m-%d-%Y, %H:%M:%S")) + "</td>" - line += "<td>" + str(log.cpu_cycles) + "</td>" - line += "<td>" + str(log.wall_clock_time) + "</td>" - if log.url_to_log_file!=None: - link = "<a href=" + '"' + str(log.url_to_log_file) + '" target="_blank">' + "logfile" + "</a>" - else: - link = "-" - line += "<td>" + link + "</td>" - results += line - - results += "</tbody>" - except: - results = "<tr><td>no data</td></tr>" + results += "<th>service</th><th>status</th><th>timestamp</th><th>cpu_cycles</th><th>wall_clock_time</th><th>logfile</th>" + results += "<tbody>" + for log in log_entries: + line = "<tr><td><b>" + log.step_name + '</b></td>' + line +='<td class="' + log.status + '" >' + log.status + "</td>" + line += "<td>" + str(log.timestamp.strftime("%m-%d-%Y, %H:%M:%S")) + "</td>" + line += "<td>" + str(log.cpu_cycles) + "</td>" + line += "<td>" + str(log.wall_clock_time) + "</td>" + if log.url_to_log_file!=None: + link = "<a href=" + '"' + str(log.url_to_log_file) + '" target="_blank">' + "logfile" + "</a>" + else: + link = "-" + line += "<td>" + link + "</td>" + results += line + + results += "</tbody>" + return results