diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-05-23 04:07:42 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-05-23 04:07:42 +0200 |
commit | 564b6ed025bdfbd93876e084e9f3dd1a6774fa5c (patch) | |
tree | eda8b2a1ae17608749c9fbbe60c62928575254c7 /source4/lib/ldb/ldb.i | |
parent | 4b95f9001b8af9c519ca0f0f6edf82964b63f409 (diff) | |
download | samba-564b6ed025bdfbd93876e084e9f3dd1a6774fa5c.tar.gz samba-564b6ed025bdfbd93876e084e9f3dd1a6774fa5c.tar.bz2 samba-564b6ed025bdfbd93876e084e9f3dd1a6774fa5c.zip |
Add proper implementation of MessageElement.__cmp__.
(This used to be commit 076e2cc356978ac313fcfdf8d8243f4ed1d629b0)
Diffstat (limited to 'source4/lib/ldb/ldb.i')
-rw-r--r-- | source4/lib/ldb/ldb.i | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/lib/ldb/ldb.i b/source4/lib/ldb/ldb.i index 21bee63ea8..061d13a2dd 100644 --- a/source4/lib/ldb/ldb.i +++ b/source4/lib/ldb/ldb.i @@ -362,14 +362,17 @@ PyObject *ldb_msg_element_to_set(struct ldb_context *ldb_ctx, %} #endif -int ldb_msg_element_compare(ldb_message_element *, ldb_message_element *); /* ldb_message_element */ %rename(MessageElement) ldb_message_element; %feature("docstring") ldb_message_element "Message element."; -%rename(ldb_message_element_compare) ldb_msg_element_compare; typedef struct ldb_message_element { %extend { #ifdef SWIGPYTHON + int __cmp__(ldb_message_element *other) + { + return ldb_msg_element_compare($self, other); + } + PyObject *__iter__(void) { return PyObject_GetIter(ldb_msg_element_to_set(NULL, $self)); @@ -400,7 +403,6 @@ typedef struct ldb_message_element { } ~ldb_message_element() { talloc_free($self); } - %rename(__cmp__) ldb_msg_element_compare; } %pythoncode { def __getitem__(self, i): |