Update for new Iodide renderer API

This commit is contained in:
Michael Droettboom 2019-02-07 21:38:39 -05:00
parent 7f0c6a9842
commit 3e0c891184
1 changed files with 6 additions and 1 deletions

View File

@ -370,8 +370,13 @@ var languagePluginLoader = new Promise((resolve, reject) => {
document.getElementsByTagName('head')[0].appendChild(link);
// Add a custom output handler for Python objects
<<<<<<< HEAD
self.iodide.addOutputHandler({
shouldHandle : (val) => {
=======
window.iodide.addOutputRenderer({
shouldRender : (val) => {
>>>>>>> Update for new Iodide renderer API
return (typeof val === 'function' &&
pyodide._module.PyProxy.isPyProxy(val));
},
@ -396,7 +401,7 @@ var languagePluginLoader = new Promise((resolve, reject) => {
div.appendChild(pre);
element = div;
}
return element;
return element.outerHTML;
}
});
}