Ñò /èêJc@sndZddklZddkZddkZd„Zdd„Zd„Zddd„Zddd „Z dS( sÐ dn.py - misc stuff for handling distinguished names (see RFC 4514) See http://www.python-ldap.org/ for details. \$Id: dn.py,v 1.9 2009/07/26 11:09:58 stroeder Exp $ Compability: - Tested with Python 2.0+ iÿÿÿÿ(t __version__NcCs|o|iddƒ}|iddƒ}|iddƒ}|iddƒ}|id d ƒ}|id d ƒ}|id dƒ}|iddƒ}|iddƒ}|ddjp|ddjodid|fƒ}n|ddjodi|d dfƒ}qn|S(sa Escape all DN special characters found in s with a back-slash (see RFC 4514, section 2.4) s\s\\t,s\,t+s\+t"s\"ts\>t;s\;t=s\=ts\it#t tiÿÿÿÿs\ (treplacetjoin(ts((s-/usr/lib64/python2.6/site-packages/ldap/dn.pytescape_dn_charss"!icCs%|pgStiiti||ƒS(sÍ This function takes a DN as string as parameter and returns a decomposed DN. It's the inverse to dn2str(). flags describes the format of the dn See also the OpenLDAP man-page ldap_str2dn(3) (tldapt functionst_ldap_function_callt_ldaptstr2dn(tdntflags((s-/usr/lib64/python2.6/site-packages/ldap/dn.pyR*s c Csqdig}|D]V}|dig}|D]2\}}}|di|t|pdƒfƒq+~ƒq~ƒS(s¸ This function takes a decomposed DN as parameter and returns a single string. It's the inverse to str2dn() but will always return a DN in LDAPv3 format compliant to RFC 4514. RRRR (R R(Rt_[1]trdnt_[2]tatypetavaluetdummy((s-/usr/lib64/python2.6/site-packages/ldap/dn.pytdn2str8sc CsÞ|pgSt||ƒ}g}x¶|D]®}|oK|idig}|D]#\}}} |t|pdƒqL~ƒƒq(|idig} |D]2\}}} | di|t|pdƒfƒq—~ ƒƒq(W|S(sô explode_dn(dn [, notypes=0]) -> list This function takes a DN and breaks it up into its component parts. The notypes parameter is used to specify that only the component's attribute values be returned and not the attribute types. RR R(RtappendR R( RtnotypesRt dn_decomptrdn_listRRRRRR((s-/usr/lib64/python2.6/site-packages/ldap/dn.pyt explode_dnEs 8 Gc Csž|pgSt||ƒd}|o0g}|D]\}}}||pdq1~Sg}|D]2\}}}|di|t|pdƒfƒqa~SdS(s explode_rdn(rdn [, notypes=0]) -> list This function takes a RDN and breaks it up into its component parts if it is a multi-valued RDN. The notypes parameter is used to specify that only the component's attribute values be returned and not the attribute types. iR RN(RR R( RRRt rdn_decompRRRRR((s-/usr/lib64/python2.6/site-packages/ldap/dn.pyt explode_rdn_s 0( t__doc__RRRtldap.functionsRRRR"R$(((s-/usr/lib64/python2.6/site-packages/ldap/dn.pyt s