Commits

leonard  committed 33a73a8

rename module from ldap to _ldap

  • Participants
  • Parent commits 0d57092

Comments (0)

Files changed (5)

File ldapmodule/CHANGES

 Change history for ldapmodule
 
+	- renamed ldap to _ldap for higher level abstraction
 1.9
 	- removed mod_next for RedHat 5.2 <esj%harvee.billerica.ma.us>
 	- fixed bug where error objects would sometimes be wrong

File ldapmodule/Demo/test.py

 import sys
 sys.path.append("/homes/leonard/src/ldapmodule")
 import getpass
-import ldap
+import _ldap
 
-#l = ldap.open("localhost", 31001)
-l = ldap.open("marta.it.uq.edu.au")
+#l = _ldap.open("localhost", 31001)
+l = _ldap.open("marta.it.uq.edu.au")
 
 login_dn = "cn=root,ou=CSEE,o=UQ,c=AU"
 login_pw = getpass.getpass("Password for %s: " % login_dn)
 	 ]
        )
 
-except ldap.LDAPError:
+except _ldap.LDAPError:
     pass
 
 #
 
 res = l.search_s(
 	"ou=CSEE, o=UQ, c=AU", 
-	ldap.SCOPE_SUBTREE, 
+	_ldap.SCOPE_SUBTREE, 
 	"objectclass=*",
       )
 print res

File ldapmodule/README

     make install  (possibly)
 
 Quick usage example:
-    import ldap
-    l = ldap.open("my_ldap_server.my_domain")
+    import _ldap
+    l = _ldap.open("my_ldap_server.my_domain")
     l.simple_bind_s("","")
-    l.search_s("o=My Organisation, c=AU", ldap.SCOPE_SUBTREE, "objectclass=*")
+    l.search_s("o=My Organisation, c=AU", _ldap.SCOPE_SUBTREE, "objectclass=*")
 
 Not included:
    Direct BER support

File ldapmodule/Setup.in.in

 #	-DNO_CACHE		- don't compile in caching methods
 #
 
-ldap  \
+_ldap  \
 	LDAPObject.o common.o constants.o errors.o functions.o  \
 	ldapmodule.o message.o version.o \
 	CIDict.o \

File ldapmodule/ldapmodule.c

 /* module initialisation */
 
 void
-initldap()
+init_ldap()
 {
 	PyObject *m, *d;
 
 #endif
 
 	/* Create the module and add the functions */
-	m = Py_InitModule("ldap", methods);
+	m = Py_InitModule("_ldap", methods);
 
 	/* Add some symbolic constants to the module */
 	d = PyModule_GetDict(m);
 
 	/* Check for errors */
 	if (PyErr_Occurred())
-		Py_FatalError("can't initialize module ldap");
+		Py_FatalError("can't initialize module _ldap");
 }