def status(self): url = self.get_absolute_url() if process_is_running(url): status = """Analysis for <em>%s</em> is currently running.""" % (self.name,) code = 2 elif process_is_complete(url): status = "%s processing is done." % self.name code = 3 elif process_is_pending(url): status = "%s is in the queue but not yet running." % self.name res = get_process_result(url) code = 1 if res is not None: status += ".. " status += str(res) else: status = "An error occured while running this analysis." code = 0 res = get_process_result(url) if res is not None: status += "..<br/> " status += str(res) status += "<br/>Please edit the scenario and try again. If the problem persists, please contact us." return (code, "<p>%s</p>" % status)
def status(self): url = self.get_absolute_url() if process_is_running(url): status = """Analysis is currently running.""" if self.progress[0] == 0: status += " (Pre-processing)" code = 2 elif process_is_complete(url): status = "Analysis completed. Compiling results..." code = 3 elif process_is_pending(url): status = "Analysis is in the queue but not yet running." res = get_process_result(url) code = 1 if res is not None: status += ".. " status += str(res) else: status = "An error occured while running this analysis." code = 0 res = get_process_result(url) if res is not None: status += "..<br/> " status += str(res) status += "<br/>Please edit the scenario and try again. If the problem persists, please contact us." return (code, "<p>%s</p>" % status)