DSML & async.py

Michael Ströder michael at stroeder.com
Thu Nov 27 16:19:34 CET 2003

Cristian S. Rocha wrote:
> I'm here again. I would like to do more modifications but the async
> module will change a lot, before I want to ask you what do you think
> about some modifications.

I already started a new module 'ldap.res' since I wanted to fix some 
mistakes I did in the design but keep the module ldap.async as is for not 
breaking existing code (mainly web2ldap and some sync scripts I've 
implemented for my customers). I think this is the way to go.

 From what I understand you're after the same thing like me:

The data read by an arbitrary XReader should be piped to an arbitrary 
YWriter. With this you would be able to pump data from DSML to LDAP server, 
convert from LDIF to DSML, etc.

Note that the Java implementation of Novell found on http://www.openldap.org 
implements classes with common interfaces. We might be able to borrow some 
ideas from this project.

Also note that the modules 'ldif' and 'dsml' (and 'ldapurl') implemented in 
pure Python were designed to be usable stand-alone without importing 
anything from the rest of python-ldap. I found this handy on some platforms 
on which it's difficult to build the C wrapper part in cases I only needed a 
LDIF parser.

So maybe best bet is to implement a new module package with interchangeable 
Reader/Writer classes and import and wrap the modules ldap, ldif and dsml. 
Not to forget implementing CSVReader/-Writer classes (with module 'csv' 
available in Python standard lib 2.3+).

Speaking of module 'csv' it would also be nice to let the Reader classes 
implement the iterator interface available since Python 2.2. Look into the 
Python 2.3 'csv' docs to get the idea.

I have currently no time do that myself but I'd be glad to review 
contributed code.

How does that sound to you?

Ciao, Michael.

More information about the python-ldap mailing list