summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorValery Febvre <vfebvre at easter-eggs.com>2004-05-16 22:32:52 +0000
committerValery Febvre <vfebvre at easter-eggs.com>2004-05-16 22:32:52 +0000
commit3dad242cb2e4a27731622d6c94ae7fa330bad227 (patch)
tree04a5de019fde3672a828239ba3f2863efb5221e2 /python
parent98d6264eadc827ff34e1bee2d3643f43567c00d0 (diff)
downloadlasso-3dad242cb2e4a27731622d6c94ae7fa330bad227.tar.gz
lasso-3dad242cb2e4a27731622d6c94ae7fa330bad227.tar.xz
lasso-3dad242cb2e4a27731622d6c94ae7fa330bad227.zip
New method lasso_node_destroy() added in class LassoNode
Diffstat (limited to 'python')
-rw-r--r--python/lasso.py6
-rw-r--r--python/lassomod.c2
-rw-r--r--python/xml/py_xml.c31
-rw-r--r--python/xml/py_xml.h2
4 files changed, 20 insertions, 21 deletions
diff --git a/python/lasso.py b/python/lasso.py
index bdf24867..666065ce 100644
--- a/python/lasso.py
+++ b/python/lasso.py
@@ -61,6 +61,9 @@ class Node:
## #self._o = lassomod.(size)
## if self._o is None: raise Error('lasso_node_new() failed')
+ def destroy(self):
+ lassomod.node_destroy(self)
+
def dump(self, encoding="utf8", format=1):
return lassomod.node_dump(self, encoding, format)
@@ -76,9 +79,6 @@ class Node:
def export_to_soap(self):
return lassomod.node_export_to_soap(self)
- def destroy(self):
- lassomod.node_unref(self)
-
def get_attr_value(self, name):
return lassomod.node_get_attr_value(self, name)
diff --git a/python/lassomod.c b/python/lassomod.c
index a393cfd5..2d719914 100644
--- a/python/lassomod.c
+++ b/python/lassomod.c
@@ -63,6 +63,7 @@ static PyMethodDef lasso_methods[] = {
/* xml */
/* py_xml.h */
+ {"node_destroy", node_destroy, METH_VARARGS},
{"node_dump", node_dump, METH_VARARGS},
{"node_export", node_export, METH_VARARGS},
{"node_export_to_base64", node_export_to_base64, METH_VARARGS},
@@ -71,7 +72,6 @@ static PyMethodDef lasso_methods[] = {
{"node_get_attr_value", node_get_attr_value, METH_VARARGS},
{"node_get_child", node_get_child, METH_VARARGS},
{"node_get_content", node_get_content, METH_VARARGS},
- {"node_unref", node_unref, METH_VARARGS},
{"node_verify_signature", node_verify_signature, METH_VARARGS},
/* py_lib_authentication_statement.h */
diff --git a/python/xml/py_xml.c b/python/xml/py_xml.c
index d7a44583..4085ccaf 100644
--- a/python/xml/py_xml.c
+++ b/python/xml/py_xml.c
@@ -43,6 +43,21 @@ PyObject *LassoNode_wrap(LassoNode *node) {
/* LassoNode */
/******************************************************************************/
+PyObject *node_destroy(PyObject *self, PyObject *args) {
+ PyObject *node_obj;
+
+ if (CheckArgs(args, "O:node_destroy")) {
+ if(!PyArg_ParseTuple(args, (char *) "O:node_destroy", &node_obj))
+ return NULL;
+ }
+ else return NULL;
+
+ lasso_node_destroy(LassoNode_get(node_obj));
+
+ Py_INCREF(Py_None);
+ return (Py_None);
+}
+
PyObject *node_dump(PyObject *self, PyObject *args) {
PyObject *node_obj;
xmlChar *encoding;
@@ -176,22 +191,6 @@ PyObject *node_get_content(PyObject *self, PyObject *args) {
return (xmlCharPtr_wrap(ret));
}
-PyObject *node_unref(PyObject *self, PyObject *args) {
- PyObject *node_obj;
-
- if (CheckArgs(args, "O:node_unref")) {
- if(!PyArg_ParseTuple(args, (char *) "O:node_unref", &node_obj))
- return NULL;
- }
- else return NULL;
-
- /* FIXME: should used a fct lasso_node_unref() ??? */
- g_object_unref (G_OBJECT (LassoNode_get(node_obj)));
-
- Py_INCREF(Py_None);
- return (Py_None);
-}
-
PyObject *node_verify_signature(PyObject *self, PyObject *args) {
PyObject *node_obj;
const gchar *certificate_file;
diff --git a/python/xml/py_xml.h b/python/xml/py_xml.h
index 82d9fed4..35665f84 100644
--- a/python/xml/py_xml.h
+++ b/python/xml/py_xml.h
@@ -36,6 +36,7 @@ typedef struct {
#define LassoNode_get(v) (((v) == Py_None) ? NULL : (((LassoNode_object *)(PyObject_GetAttr(v, PyString_FromString("_o"))))->obj))
PyObject *LassoNode_wrap(LassoNode *node);
+PyObject *node_destroy(PyObject *self, PyObject *args);
PyObject *node_dump(PyObject *self, PyObject *args);
PyObject *node_export(PyObject *self, PyObject *args);
PyObject *node_export_to_base64(PyObject *self, PyObject *args);
@@ -44,7 +45,6 @@ PyObject *node_export_to_soap(PyObject *self, PyObject *args);
PyObject *node_get_attr_value(PyObject *self, PyObject *args);
PyObject *node_get_child(PyObject *self, PyObject *args);
PyObject *node_get_content(PyObject *self, PyObject *args);
-PyObject *node_unref(PyObject *self, PyObject *args);
PyObject *node_verify_signature(PyObject *self, PyObject *args);
#endif /* __PYLASSO_PY_XML_H__ */