[SCM] Samba Shared Repository - branch v4-0-test updated -
release-4-0-0alpha4-46-g3d798a1
Jelmer Vernooij
jelmer at samba.org
Sun Jun 8 02:41:47 GMT 2008
The branch, v4-0-test has been updated
via 3d798a1440603b7929955f2120f09ba1482885a1 (commit)
from abcbce004c99a2c62aa8c7a7cfc8ac5b5cfeb7dd (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test
- Log -----------------------------------------------------------------
commit 3d798a1440603b7929955f2120f09ba1482885a1
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Sun Jun 8 04:20:26 2008 +0200
Add more docstrings in tdb.
-----------------------------------------------------------------------
Summary of changes:
source/lib/tdb/tdb.i | 4 ++++
source/lib/tdb/tdb.py | 14 ++++++++++++++
source/lib/tdb/tdb_wrap.c | 10 ++++++++--
3 files changed, 26 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/lib/tdb/tdb.i b/source/lib/tdb/tdb.i
index 5f23568..3d8b697 100644
--- a/source/lib/tdb/tdb.i
+++ b/source/lib/tdb/tdb.i
@@ -160,6 +160,8 @@ typedef struct tdb_context {
tdb(const char *name, int hash_size, int tdb_flags, int flags, mode_t mode) {
return tdb_open(name, hash_size, tdb_flags, flags, mode);
}
+ %feature("docstring") error "S.error() -> int\n"
+ "Find last error number returned by operation on this TDB.";
enum TDB_ERROR error();
~tdb() { tdb_close($self); }
%feature("docstring") close "S.close() -> None\n"
@@ -179,6 +181,8 @@ typedef struct tdb_context {
%feature("docstring") store "S.store(key, value, flag=TDB_REPLACE) -> None\n"
"Store an entry.";
int store(TDB_DATA key, TDB_DATA dbuf, int flag);
+ %feature("docstring") exists "S.exists(key) -> bool\n"
+ "Check whether key exists in this database.";
int exists(TDB_DATA key);
%feature("docstring") firstkey "S.firstkey() -> data\n"
"Return the first key in this database.";
diff --git a/source/lib/tdb/tdb.py b/source/lib/tdb/tdb.py
index a8c1d06..9f306ba 100644
--- a/source/lib/tdb/tdb.py
+++ b/source/lib/tdb/tdb.py
@@ -92,6 +92,13 @@ class Tdb(object):
Open a TDB file.
"""
_tdb.Tdb_swiginit(self,_tdb.new_Tdb(*args, **kwargs))
+ def error(*args, **kwargs):
+ """
+ S.error() -> int
+ Find last error number returned by operation on this TDB.
+ """
+ return _tdb.Tdb_error(*args, **kwargs)
+
__swig_destroy__ = _tdb.delete_Tdb
def close(*args, **kwargs):
"""
@@ -128,6 +135,13 @@ class Tdb(object):
"""
return _tdb.Tdb_store(*args, **kwargs)
+ def exists(*args, **kwargs):
+ """
+ S.exists(key) -> bool
+ Check whether key exists in this database.
+ """
+ return _tdb.Tdb_exists(*args, **kwargs)
+
def firstkey(*args, **kwargs):
"""
S.firstkey() -> data
diff --git a/source/lib/tdb/tdb_wrap.c b/source/lib/tdb/tdb_wrap.c
index 27da552..32665d7 100644
--- a/source/lib/tdb/tdb_wrap.c
+++ b/source/lib/tdb/tdb_wrap.c
@@ -3628,7 +3628,10 @@ static PyMethodDef SwigMethods[] = {
"S.__init__(name,hash_size=0,tdb_flags=TDB_DEFAULT,flags=O_RDWR,mode=0600)\n"
"Open a TDB file.\n"
""},
- { (char *)"Tdb_error", (PyCFunction)_wrap_Tdb_error, METH_O, NULL},
+ { (char *)"Tdb_error", (PyCFunction)_wrap_Tdb_error, METH_O, (char *)"\n"
+ "S.error() -> int\n"
+ "Find last error number returned by operation on this TDB.\n"
+ ""},
{ (char *)"delete_Tdb", (PyCFunction)_wrap_delete_Tdb, METH_O, NULL},
{ (char *)"Tdb_close", (PyCFunction)_wrap_Tdb_close, METH_O, (char *)"\n"
"S.close() -> None\n"
@@ -3651,7 +3654,10 @@ static PyMethodDef SwigMethods[] = {
"S.store(key, value, flag=TDB_REPLACE) -> None\n"
"Store an entry.\n"
""},
- { (char *)"Tdb_exists", (PyCFunction) _wrap_Tdb_exists, METH_VARARGS | METH_KEYWORDS, NULL},
+ { (char *)"Tdb_exists", (PyCFunction) _wrap_Tdb_exists, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
+ "S.exists(key) -> bool\n"
+ "Check whether key exists in this database.\n"
+ ""},
{ (char *)"Tdb_firstkey", (PyCFunction)_wrap_Tdb_firstkey, METH_O, (char *)"\n"
"S.firstkey() -> data\n"
"Return the first key in this database.\n"
--
Samba Shared Repository
More information about the samba-cvs
mailing list