[svn] commit: r2085 - in /experiments/python-binding/src/lib/dns/python: name_python.cc question_python.cc rrset_python.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Jun 7 13:37:25 UTC 2010


Author: jelte
Date: Mon Jun  7 13:37:25 2010
New Revision: 2085

Log:
removed some unnecessary comment lines
added a few missing __str__ functions

Modified:
    experiments/python-binding/src/lib/dns/python/name_python.cc
    experiments/python-binding/src/lib/dns/python/question_python.cc
    experiments/python-binding/src/lib/dns/python/rrset_python.cc

Modified: experiments/python-binding/src/lib/dns/python/name_python.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/python/name_python.cc (original)
+++ experiments/python-binding/src/lib/dns/python/name_python.cc Mon Jun  7 13:37:25 2010
@@ -38,22 +38,6 @@
 // end
 //
 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 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 @@
     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 @@
 }
 
 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;

Modified: experiments/python-binding/src/lib/dns/python/question_python.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/python/question_python.cc (original)
+++ experiments/python-binding/src/lib/dns/python/question_python.cc Mon Jun  7 13:37:25 2010
@@ -16,20 +16,6 @@
 
 #include <dns/question.h>
 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

Modified: experiments/python-binding/src/lib/dns/python/rrset_python.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/python/rrset_python.cc (original)
+++ experiments/python-binding/src/lib/dns/python/rrset_python.cc Mon Jun  7 13:37:25 2010
@@ -65,6 +65,7 @@
 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 @@
     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 @@
 }
 
 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;




More information about the bind10-changes mailing list