svn commit: samba r15343 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

tpot at samba.org tpot at samba.org
Sun Apr 30 00:38:19 GMT 2006


Author: tpot
Date: 2006-04-30 00:38:19 +0000 (Sun, 30 Apr 2006)
New Revision: 15343

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15343

Log:
Some small cleanups.

Remove LdbMessage.close() method as it's not necessary.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py	2006-04-30 00:36:29 UTC (rev 15342)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py	2006-04-30 00:38:19 UTC (rev 15343)
@@ -29,10 +29,16 @@
 if result != 0:
     raise LdbError, (result, 'ldb_global_init failed')
 
+# Ldb exceptions
+
 class LdbError(Exception):
-    """An exception raised when a ldb error occurs."""
+    """An exception raised when a ldb error occurs.
+    The exception data is a tuple consisting of the ldb number and a
+    string description of the error."""
     pass
 
+# Ldb classes
+
 class LdbMessage:
     """A class representing a ldb message as a Python dictionary."""
     
@@ -41,9 +47,6 @@
         self.msg = ldb_msg_new(self.mem_ctx)
 
     def __del__(self):
-        self.close()
-
-    def close(self):
         if self.mem_ctx is not None:
             talloc_free(self.mem_ctx)
             self.mem_ctx = None
@@ -88,7 +91,7 @@
         self.mem_ctx = talloc_init('mem_ctx for ldb 0x%x' % id(self))
         self.ldb_ctx = ldb_init(self.mem_ctx)
 
-        result =  ldb_connect(self.ldb_ctx, url, flags, None)
+        result = ldb_connect(self.ldb_ctx, url, flags, None)
 
         if result != LDB_SUCCESS:
             raise LdbError, (result, ldb_strerror(result))



More information about the samba-cvs mailing list