Home | Trees | Indices | Help |
|
---|
|
1 """ 2 Support for writing a set of directory entries as LDIF. 3 You probably want to use this only indirectly, as in 4 str(LDAPEntry(...)). 5 6 TODO support writing modify operations 7 TODO support reading modify operations 8 9 TODO implement rest of syntax from RFC2849 10 11 """ 12 13 # RFC2849: The LDAP Data Interchange Format (LDIF) - Technical Specification 14 15 import base64 16 19 22 2830 if value.startswith('\0') \ 31 or value.startswith('\n') \ 32 or value.startswith('\r') \ 33 or value.startswith(' ') \ 34 or value.startswith(':') \ 35 or value.startswith('<') \ 36 or value.endswith(' ') \ 37 or containsNonprintable(value): 38 return attributeAsLDIF_base64(attribute, value) 39 else: 40 return "%s: %s\n" % (attribute, value)4143 s="dn: %s\n"%dn 44 for k,vs in attributes: 45 for v in vs: 46 s=s+attributeAsLDIF(k, v) 47 s=s+"\n" 48 return s49 5254 s=[header()] 55 for dn, attributes in objects: 56 s.append(asLDIF(dn, attributes)) 57 return ''.join(s)58
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat May 31 18:33:59 2008 | http://epydoc.sourceforge.net |