Esempio n. 1
0
 async def get(self, silent=False):
     """Return the result or raise an exception based on the success status."""
     if await self.success:
         return await self.result
     elif await self.is_message_failure:
         if not silent:
             for msg in self.iter_messages():
                 logger.warning(msg)
             return self.result
     else:
         raise WolframEvaluationException("Evaluation failed.", messages=await self.failure)
Esempio n. 2
0
    def get(self, silent=True):
        """Return the result or raise an exception.

        `silent` can be set to False to log all messages with warning severity. """
        if self.success:
            return self.result
        elif self.is_message_failure:
            if not silent:
                for msg in self.iter_messages():
                    logger.warning(msg)
            return self.result
        else:
            raise WolframEvaluationException("Evaluation failed.", messages=self.failure)