use of com.twosigma.beakerx.mimetype.MIMEContainer in project beakerx by twosigma.
the class MessageCreator method showResult.
private static boolean showResult(SimpleEvaluationObject seo) {
boolean ret = true;
if (seo != null && seo.getPayload() != null && seo.getPayload() instanceof MIMEContainer) {
MIMEContainer input = (MIMEContainer) seo.getPayload();
ret = !MIMEContainer.MIME.HIDDEN.equals(input.getMime().asString());
} else if ((seo != null && !seo.getOutputdata().isEmpty())) {
ret = true;
}
return ret;
}
use of com.twosigma.beakerx.mimetype.MIMEContainer in project beakerx by twosigma.
the class CompiledCodeRunner method runCompiledCodeAndPublish.
public static void runCompiledCodeAndPublish(Message message, ExecuteCompiledCode handler, Object... params) {
final SimpleEvaluationObject seo = initOutput(message);
InternalVariable.setValue(seo);
KernelManager.get().publish(singletonList(MessageCreator.buildClearOutput(message, true)));
try {
Object result = handler.executeCode(params);
if (result != null) {
List<MIMEContainer> resultString = MIMEContainerFactory.createMIMEContainers(result);
KernelManager.get().publish(singletonList(MessageCreator.buildDisplayData(message, resultString)));
}
} catch (Exception e) {
printError(message, seo, e);
}
seo.clrOutputHandler();
}
Aggregations