summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/pyldb.c91
1 files changed, 0 insertions, 91 deletions
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index 9b1380a655..c30953859a 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -1981,94 +1981,3 @@ void initldb(void)
PyModule_AddObject(m, "Module", (PyObject *)&PyLdbModule);
PyModule_AddObject(m, "Tree", (PyObject *)&PyLdbTree);
}
-
-#if 0
-
-/* ldb_message_element */
-%rename(MessageElement) ldb_message_element;
-%feature("docstring") ldb_message_element "Message element.";
-typedef struct ldb_message_element {
- %extend {
- PyObject *__set__(void)
- {
- return ldb_msg_element_to_set(NULL, $self);
- }
-
- ldb_message_element(PyObject *set_obj, int flags=0, const char *name = NULL)
- {
- return PyObject_AsMessageElement(NULL, set_obj, flags, name);
- }
-
- }
- %pythoncode {
- def __getitem__(self, i):
- ret = self.get(i)
- if ret is None:
- raise KeyError("no such value")
- return ret
-
- def __repr__(self):
- return "MessageElement([%s])" % (",".join(repr(x) for x in self.__set__()))
- }
-} ldb_message_element;
-
-/* ldb_message */
-
-typedef struct ldb_message {
- ldb_dn *dn;
-
- %extend {
- ldb_msg(ldb_dn *dn = NULL) {
- ret->dn = talloc_reference(ret, dn);
- return ret;
- }
-
- void __setitem__(const char *attr_name, ldb_message_element *val)
- {
- struct ldb_message_element *el;
-
- ldb_msg_remove_attr($self, attr_name);
-
- el = talloc($self, struct ldb_message_element);
- el->name = talloc_strdup(el, attr_name);
- el->num_values = val->num_values;
- el->values = talloc_reference(el, val->values);
-
- ldb_msg_add($self, el, val->flags);
- }
-
- void __setitem__(const char *attr_name, PyObject *val)
- {
- }
-%pythoncode {
- def get(self, key, default=None):
- if key == "dn":
- return self.dn
- return self.find_element(key)
-
- def iteritems(self):
- for k in self.keys():
- yield k, self[k]
-
- def items(self):
- return list(self.iteritems())
-
- def __repr__(self):
- return "Message(%s)" % repr(dict(self.iteritems()))
-}
- }
-} ldb_msg;
-
-typedef struct ldb_context {
- %pythoncode {
- def itermodules(self):
- m = self.firstmodule
- while m is not None:
- yield m
- m = m.next
-
- def modules(self):
- return list(self.itermodules())
- }
-} ldb;
-#endif