|
From: <mi...@st...> - 2003-05-27 08:34:05
|
Andrew Thomson wrote:
> any tips today? ;)
Let's see... ;-)
> ---
> import ldif
>
> f = open('data.ldiff','r')
>
> records = ldif.LDIFRecordList(f)
> data = records.parse()
> ---
This parses the whole input file and stores the data into a list in memory
which might not be suitable for very large LDIF files.
For stream-processing large LDIF files you simply have to sub-class
ldif.LDIFParser and implement the method handle(self,dn,entry).
Ciao, Michael.
|