Example #1
0
    def resolve(self):
        """Standard i/o prompt for resolution of an individual query"""
        if armi.MPI_RANK != 0:
            return

        if self.condition():
            try:
                if self.isCorrective():
                    try:
                        make_correction = runLog.prompt(
                            "INSPECTOR: " + self.statement,
                            self.question,
                            "YES_NO",
                            "NO_DEFAULT",
                            "CANCEL",
                        )
                        if make_correction:
                            self.correction()
                            self._corrected = True
                        else:
                            self._passed = True
                    except exceptions.RunLogPromptCancel:
                        raise exceptions.InputInspectionDiscontinued()
                else:
                    try:
                        continue_submission = runLog.prompt(
                            "INSPECTOR: " + self.statement,
                            "Continue?",
                            "YES_NO",
                            "NO_DEFAULT",
                            "CANCEL",
                        )
                        if not continue_submission:
                            raise exceptions.InputInspectionDiscontinued()
                    except exceptions.RunLogPromptCancel:
                        raise exceptions.InputInspectionDiscontinued()

            except exceptions.RunLogPromptUnresolvable:
                self.autoResolved = False
                self._passed = True
Example #2
0
 def _raise(self):  # pylint: disable=no-self-use
     raise exceptions.InputInspectionDiscontinued(
         "Input inspection has been interrupted.")