From 79d466c37397a9d3d236f1c81d7d7fda479bd052 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 11 Jan 2008 04:05:41 +0100 Subject: ldb/python: Support comparing Dn's to strings. (This used to be commit 355878907970b396e4031426fda260d981c417eb) --- source4/lib/ldb/ldb.i | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4/lib/ldb/ldb.i') diff --git a/source4/lib/ldb/ldb.i b/source4/lib/ldb/ldb.i index 2604393e8f..560142eb6d 100644 --- a/source4/lib/ldb/ldb.i +++ b/source4/lib/ldb/ldb.i @@ -201,6 +201,14 @@ fail: /* FIXME: implement __getslice__ */ #endif + %pythoncode { + def __eq__(self, other): + if isinstance(other, self.__class__): + return self.__cmp__(other) == 0 + if isinstance(other, str): + return str(self) == other + return False + } } } ldb_dn; -- cgit