BIND 10 #2542: add Python wrapper of addZone() interface
BIND 10 Development
do-not-reply at isc.org
Thu Dec 13 18:20:47 UTC 2012
#2542: add Python wrapper of addZone() interface
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | jinmei
Priority: medium | Status:
Component: data source | reviewing
Keywords: | Milestone:
Sensitive: 0 | Sprint-20121218
Sub-Project: DNS | Resolution:
Estimated Difficulty: 0 | CVSS Scoring:
Total Hours: 0 | Defect Severity: N/A
| Feature Depending on Ticket:
| background zone loading
| Add Hours to Ticket: 0
| Internal?: 0
-------------------------------------+-------------------------------------
Comment (by jinmei):
'''client_python.cc'''
- a minor point, and maybe a mater of taste, but variable `result`
doesn't seem to be necessary:
{{{#!cpp
if (self->client->createZone(PyName_ToName(name))) {
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;
}
}}}
'''client_inc.cc'''
I'd like to keep pydoc for wrappers of the C++ API consistent with the
original doxygen document as much as possible, using tools like the
one I made in #933 (a snapshot version only). It seems the pydoc in
this branch was written by hand (maybe by copying some portion of the
doxygen), missing some of the original text, and containing some long
lines (which would look like if you browse it on the Python
interpreter).
My suggested text using the above tool is:
{{{#!cpp
const char* const DataSourceClient_createZone_doc = "\
create_zone(name) -> bool\n\
\n\
Create a zone in the database.\n\
\n\
Creates a new (empty) zone in the data source backend, which can\n\
subsequently be filled with data (through get_updater()).\n\
\n\
Note: This is a tentative API, and this method is likely to change or\n\
be removed in the near future. For that reason, it currently provides\n\
a default implementation that throws NotImplemented.\n\
\n\
Apart from the two exceptions mentioned below, in theory this call can\n\
throw anything, depending on the implementation of the datasource\n\
backend.\n\
\n\
Exceptions:\n\
NotImplemented If the datasource backend does not support direct\n\
zone creation.\n\
DataSourceError If something goes wrong in the data source while\n\
creating the zone.\n\
\n\
Parameters:\n\
name The (fully qualified) name of the zone to create\n\
\n\
Return Value(s): True if the zone was added, false if it already\n\
existed\n\
";
}}}
Hmm, and I just noticed "Create a zone in the database." in the 1-line
summary (the "\brief" description) is not really appropriate. It
should actually be, e.g., "in the data source". Please update at
least the original C++ doxygen doc. And, if you adopt the above
suggested pydoc string, please make the same change.
With these I think the branch can be merged.
--
Ticket URL: <http://bind10.isc.org/ticket/2542#comment:5>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list