def run(self, output_func, phasename, wfsys, task, alwaysRun, options): """ Displays a notice to the user Arguments: output_func: Method for writing status to, which takes arguments, line to write and boolean indicating if end of line Returns: True if should continue False if should stop """ self.status = constants.SUCCESS # Assuming here that a terminal is 80 characters wide. # This should be changed to match the term_size variable # in the workflow engine. asterisk = "{0:*^80}" taskmsg = utils.extractIniParam(self.task.config.iniparams, self.task.msg) if taskmsg != self.task.msg: log.debug("Taken taskmsg\n%s\nfrom ini file parameter %s" % (taskmsg, self.task.msg)) log.info(asterisk.format('')) log.info("TASK %s: Notice\n" % self.getId()) log.info(taskmsg) log.info("\nRESULT %s: Complete" % self.getId()) log.info(asterisk.format('')) return WorkflowStatus(WorkflowStatus.COMPLETE, "")
def run(self, output_func, phasename, wfsys, task, alwaysRun, options): """ Asks users whether to pause or not Arguments: output_func: Method for writing status to, which takes arguments, line to write and boolean indicating if end of line Returns: True if should continue False if should stop """ self.status = constants.SUCCESS # Assuming here that a terminal is 80 characters wide. # This should be changed to match the term_size variable # in the workflow engine. asterisk = "{0:*^80}" taskmsg = utils.extractIniParam(self.task.config.iniparams, self.task.msg) if taskmsg != self.task.msg: log.debug("Taken taskmsg\n%s\nfrom ini file parameter %s" % (taskmsg, self.task.msg)) msg = asterisk.format("") + "\n" + \ "TASK %s: %s (y/n)\n" % (self.getId(), taskmsg) success_msg = "RESULT %s: Continuing" % self.getId() + "\n" +\ asterisk.format('') return WorkflowStatus(WorkflowStatus.USER_INPUT, msg, success_msg)
def run(self, output_func, phasename, wfsys, task, alwaysRun, options): """ Runs a pause task Arguments: output_func: Method for writing status to, which takes arguments, line to write and boolean indicating if end of line Returns: WorkflowStatus """ self.status = constants.SUCCESS # Assuming here that a terminal is 80 characters wide. # This should be changed to match the term_size variable # in the workflow engine. asterisk = "{0:*^80}" taskmsg = utils.extractIniParam(self.task.config.iniparams, self.task.msg) if taskmsg != self.task.msg: log.debug("Taken taskmsg\n%s\nfrom ini file parameter %s" % (taskmsg, self.task.msg)) log.info(asterisk.format('')) log.info("TASK %s: %s\n" % (self.getId(), taskmsg)) log.info("RESULT %s: Escaping ...\n" % self.getId()) log.info(asterisk.format('')) return WorkflowStatus(WorkflowStatus.STOPPED, "")