async.LDIFWriter

Andrew Thomson ajthomson at optushome.com.au
Mon May 26 09:39:51 CEST 2003


Thanks, that's perfect..

one other question if I may.. how can I modify the following,

__init__(self, output_file, base64_attrs=None, cols=76, line_sep='\n')
    output_file
        file object for output
    base64_attrs
        list of attribute types to be base64-encoded in any case
    cols
        Specifies how many columns a line may have before it's
        folded into many lines.
    line_sep
        String used as line separator

to increase the column length.. some of my entries are wrapping.

Regards,

ajt.

On Mon, May 26, 2003 at 07:50:55AM +0200, Michael Str?der wrote:
> Andrew Thomson wrote:
> > It's great to be able to crank out the ldiff data from a running tree
> > using async.LDIFWriter
> >
> > When we do this,
> >
> > s = ldap.async.LDIFWriter(
> >    ldap.initialize('ldap://localhost:389'),
> >
> > is it possible to incorporate bind details??
> 
> import ldap,ldap.async
> 
> f = open('results.ldif','w')
> l = ldap.initialize('ldap://localhost:389')
> l.protocol_version = ldap.VERSION3
> l.simple_bind_s('cn=Directory Manager','top secret')
> s = ldap.async.LDIFWriter(l,f)
> s.startSearch('dc=example,dc=com',ldap.SCOPE_SUBTREE,'(objectClass=*)')
> s.processResults()
> 
> Note that this will write the entries in the order they are returned from 
> the server. This is not necessarily the right tree order.
> 
> > ie, so I can log in as the
> > directory manager and not be restricted by the SIZELIMIT_EXCEEDED
> 
> This is a matter of the LDAP server implementation. If the server does not 
> impose any search limits for 'cn=Directory Manager' in the example above 
> you will be able to retrieve all results.
> 
> Ciao, Michael.
> 
> 





More information about the python-ldap mailing list