Hi, 2009/5/16 Michael Ströder <mich...@stroeder.com>: > Guruprasad wrote: >> Hi, >> I tried generating a LDIF file from a dictionary using 'ldif' module >> as illustrated in http://www.python-ldap.org/doc/html/ldif.html. But >> at the end of the LDIF data, I get a newline and a 'None', whereas >> there is no such thing in the result shown in that example. How to get >> rid of those unwanted characters. I am using Python-LDAP 2.3.5-1 on >> Debian Lenny. > > Could you please post your code (in a short form) demonstrating the > issue? Note that there is a new-line after each entry record. But was > 'None' is in your case is not clear to me. >
Basically what I am trying to do with this code is that, I manipulate the result returned by ldapsearch to remove some attributes and generate a LDIF output for the modified entry. <code> res_type, result_data=l.result(res_id,0) if (result_data==[]): break dn=result_data[0][0] resd=result_data[0][1] resd["objectClass"].remove("inetLocalMailRecipient") resd["objectClass"].remove("organizationalPerson") resd["objectClass"].remove("inetOrgPerson") resd["objectClass"].remove("posixAccount") lw=ldif.LDIFWriter(sys.stdout) guru=lw.unparse(dn,resd) print guru </code> Is it some issue or am I making some mistakes with general usage of Python? Thank you. Regards, L.Guruprasad ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Python-LDAP-dev mailing list Python-LDAP-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/python-ldap-dev