Open niuzhenjiang opened 3 years ago
You can do some hacks to redirect the stdout/stderr output of the OpenBabel module:
var EU = Kekule.EmscriptenUtils;
EU.getRootModule = function(moduleName, creationOptions)
{
var result = EU._createdModules[moduleName];
if (!result)
{
var m = EU._getActualModule(moduleName);
result = m({
'print': function(text) { console.log('[stdout]' + text); }, // redirect the stdout output
'printErr': function(text) { console.log('[stderr]' + text); }, // redirect the stderr output
});
EU._createdModules[moduleName] = result;
}
return result;
}
Kekule.OpenBabel.enable();
sorry to ask you some weird question... i use openbabel.js for smiles import plugin.but my smiles have some error ,can't generate. i want to know how can i catch this warning to tell user smiles have some error.![image](https://user-images.githubusercontent.com/42111602/124059016-fcea6c00-da5c-11eb-86bc-cfdd5b7fcdb4.png)