RSSyl: Allow use of .netrc by libcurl. Bug/enhancement #3309, by Vincent Pelletier
[claws.git] / src / plugins / python / nodetype.c
index 8bf8b650cb13fe3ffbe43051ee88777191eca4f4..70f4978a8a35e2fa4e427687e20fe11ebc4f925d 100644 (file)
 #include "claws-features.h"
 #endif
 
-#include <glib.h>
-#include <glib/gi18n.h>
-
 #include "nodetype.h"
 
+#include <glib/gi18n.h>
+
 #include <structmember.h>
 
-PyMODINIT_FUNC initnode(PyObject *module)
+/* returns true on success, false if an exception was thrown */
+gboolean cmpy_add_node(PyObject *module)
 {
+  gboolean retval;
   PyObject *dict;
   PyObject *res;
   const char *cmd =
@@ -85,9 +86,13 @@ PyMODINIT_FUNC initnode(PyObject *module)
     PyDict_SetItemString(dict, "__builtins__", PyEval_GetBuiltins());
 
   res = PyRun_String(cmd, Py_file_input, dict, dict);
+
+  retval = (res != NULL);
   Py_XDECREF(res);
+  return retval;
 }
 
+
 PyObject* clawsmail_node_new(PyObject *module)
 {
   PyObject *class, *dict;