diff options
author | Jelte Jansen <jelte@isc.org> | 2010-06-07 15:37:25 +0200 |
---|---|---|
committer | Jelte Jansen <jelte@isc.org> | 2010-06-07 15:37:25 +0200 |
commit | b75fd438e1457919e2851d8ab600eddf8ddde2cf (patch) | |
tree | 225840e76cb47a1935e66be4962eff1bb40d20da /src/lib/dns/python | |
parent | oh no, more docs! (diff) | |
download | kea-b75fd438e1457919e2851d8ab600eddf8ddde2cf.tar.xz kea-b75fd438e1457919e2851d8ab600eddf8ddde2cf.zip |
removed some unnecessary comment lines
added a few missing __str__ functions
git-svn-id: svn://bind10.isc.org/svn/bind10/experiments/python-binding@2085 e5f2f494-b856-4b98-b285-d166d9295462
Diffstat (limited to '')
-rw-r--r-- | src/lib/dns/python/name_python.cc | 26 | ||||
-rw-r--r-- | src/lib/dns/python/question_python.cc | 14 | ||||
-rw-r--r-- | src/lib/dns/python/rrset_python.cc | 10 |
3 files changed, 18 insertions, 32 deletions
diff --git a/src/lib/dns/python/name_python.cc b/src/lib/dns/python/name_python.cc index c94a348864..63df50b844 100644 --- a/src/lib/dns/python/name_python.cc +++ b/src/lib/dns/python/name_python.cc @@ -40,22 +40,6 @@ static PyObject* po_IscException; static PyObject* po_NameRelation; // -// Declaration of class constants -// Initialization and addition of these go in the module init at the -// end -// -/* -static PyObject* po_MAX_WIRE; -static PyObject* po_MAX_LABELS; -static PyObject* po_MAX_LABELLEN; -static PyObject* po_MAX_COMPRESS_POINTER; -static PyObject* po_COMPRESS_POINTER_MARK8; -static PyObject* po_COMPRESS_POINTER_MARK16; -static PyObject* po_ROOT_NAME; -*/ - - -// // Definition of the classes // @@ -188,6 +172,7 @@ static void Name_destroy(s_Name* self); static PyObject* Name_toWire(s_Name* self, PyObject* args); static PyObject* Name_toText(s_Name* self); +static PyObject* Name_str(PyObject* self); static PyObject* Name_getLabelCount(s_Name* self); static PyObject* Name_at(s_Name* self, PyObject* args); static PyObject* Name_getLength(s_Name* self); @@ -255,7 +240,7 @@ static PyTypeObject name_type = { NULL, /* tp_as_mapping */ NULL, /* tp_hash */ NULL, /* tp_call */ - NULL, /* tp_str */ + Name_str, /* tp_str */ NULL, /* tp_getattro */ NULL, /* tp_setattro */ NULL, /* tp_as_buffer */ @@ -417,6 +402,13 @@ Name_toText(s_Name* self) } static PyObject* +Name_str(PyObject* self) +{ + // Simply call the to_text method we already defined + return PyObject_CallMethod(self, (char*)"to_text", (char*)""); +} + +static PyObject* Name_toWire(s_Name* self, PyObject* args) { PyObject* bytes; diff --git a/src/lib/dns/python/question_python.cc b/src/lib/dns/python/question_python.cc index 7451d75578..0534926782 100644 --- a/src/lib/dns/python/question_python.cc +++ b/src/lib/dns/python/question_python.cc @@ -18,20 +18,6 @@ using namespace isc::dns; // -// Declaration of the custom exceptions -// Initialization and addition of these go in the initModulePart -// function at the end of this file -// - -// -// Definition of the classes -// - -// For each class, we need a struct, a helper functions (init, destroy, -// and static wrappers around the methods we export), a list of methods, -// and a type description - -// // Question // diff --git a/src/lib/dns/python/rrset_python.cc b/src/lib/dns/python/rrset_python.cc index 2e8c8e204c..e3d20c4dae 100644 --- a/src/lib/dns/python/rrset_python.cc +++ b/src/lib/dns/python/rrset_python.cc @@ -65,6 +65,7 @@ static PyObject* RRset_getTTL(s_RRset* self); static PyObject* RRset_setName(s_RRset* self, PyObject* args); static PyObject* RRset_setTTL(s_RRset* self, PyObject* args); static PyObject* RRset_toText(s_RRset* self); +static PyObject* RRset_str(PyObject* self); static PyObject* RRset_toWire(s_RRset* self, PyObject* args); static PyObject* RRset_addRdata(s_RRset* self, PyObject* args); static PyObject* RRset_getRdata(s_RRset* self); @@ -117,7 +118,7 @@ static PyTypeObject rrset_type = { NULL, /* tp_as_mapping */ NULL, /* tp_hash */ NULL, /* tp_call */ - NULL, /* tp_str */ + RRset_str, /* tp_str */ NULL, /* tp_getattro */ NULL, /* tp_setattro */ NULL, /* tp_as_buffer */ @@ -312,6 +313,13 @@ RRset_toText(s_RRset* self) } static PyObject* +RRset_str(PyObject* self) +{ + // Simply call the to_text method we already defined + return PyObject_CallMethod(self, (char*)"to_text", (char*)""); +} + +static PyObject* RRset_toWire(s_RRset* self, PyObject* args) { PyObject* bytes; |