PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  0Sc@sdZdZddlZddlZddddfZd Zd ddYZyddlZddl ZWne k rn3Xdej j j fdYZdddYZdS(s dsml - generate and parse DSMLv1 data (see http://www.oasis-open.org/committees/dsml/) See http://www.python-ldap.org/ for details. $Id: dsml.py,v 1.32 2014/03/12 23:11:26 stroeder Exp $ Python compability note: Tested with Python 2.0+. s2.4.15iNt&s&t. indent String used for indentiation of next nested level. ts cCs=||_ijttj||_||_||_dS(N(t _output_filetfromkeystmapRtlowert _base64_attrst _dsml_commentt_indent(tselftft base64_attrst dsml_commenttindent((s*/usr/lib64/python2.7/site-packages/dsml.pyt__init__0s  cCsP|jr"|jjtj|Syt|dWntk rGdSXdSdS(Nsutf-8ii(Rthas_keyRRtunicodet UnicodeError(Rt attr_typet attr_value((s*/usr/lib64/python2.7/site-packages/dsml.pyt_needs_base64_encoding8s  cCs|jjdjdddd|jg|jr|jjd|j|jjd|j|jf|jjd|jnd S( s Write the header s s&sDs1s%s s%s N(R twritetjoinRR(R((s*/usr/lib64/python2.7/site-packages/dsml.pyt writeHeaderCs  cCs+|jjd|j|jjddS(s Write the footer s%s s N(R R R(R((s*/usr/lib64/python2.7/site-packages/dsml.pyt writeFooterSscCs|j||S(N(t writeRecord(Rtdntentry((s*/usr/lib64/python2.7/site-packages/dsml.pytunparseZsc Cs|jjd|jdt|f|jd|jdg}|jjd|jdx/|D]'}|jjd|jd|fqgW|jjd |jd|j}y|jd|jdWntk rnX|jx|D]}|jjd |jd|fx||D]}|j ||}|r_t j |}n t|}|jjd |jdd |f|jjd |jd|f|jjd|jdfq/W|jjd|jdqW|jjd|jddS(s dn string-representation of distinguished name entry dictionary holding the LDAP entry {attr:data} s%s it objectclasst objectClasss%s is$%s%s is%s s%s s%s s encoding="base64"s%s%s is%s s%s s%s N( R R RR tgettkeystremovet ValueErrortsortRtbase64t encodestring( RR%R&t objectclassestoct attr_typesRtattr_value_itemtneeds_base64_encoding((s*/usr/lib64/python2.7/site-packages/dsml.pyR$]sD  %     !        ( t__name__t __module__t__doc__RRR"R#R'R$(((s*/usr/lib64/python2.7/site-packages/dsml.pyR s   t DSMLv1HandlercBsDeZdZdZdZdZdZdZdZRS(s* Content handler class for DSMLv1 cCs#||_tjjjj|dS(N(t_parser_instancetxmltsaxthandlertContentHandlerR(Rtparser_instance((s*/usr/lib64/python2.7/site-packages/dsml.pyRs cCsdS(N((R((s*/usr/lib64/python2.7/site-packages/dsml.pyt startDocumentscCsdS(N((R((s*/usr/lib64/python2.7/site-packages/dsml.pyt endDocumentscCs|jdstd|d}|dkr4n|dkrLd|_n|dkrq|d|_i|_n|d kr|d jd |_g|_nv|d krd|_|j d dj dk|_ n=|dkrg|_ n%|dkrd|_ n td|dS(NR s Illegal nameitdsmlsdirectory-entriesiR&R%tattrtnamesutf-8tvaluetencodingR/R(soc-valuesUnknown tag %s(t startswithtAssertionErrort_parsing_entriest_dnt_entrytencodet _attr_typet _attr_valuest _attr_valueR*Rt_base64_encodingt_object_classest _oc_valueR-(Rtraw_nametattrsRD((s*/usr/lib64/python2.7/site-packages/dsml.pyt startElements(           $    cCs|jdstd|d}|dkr4nM|dkrLd|_n5|dkr|jj|j|j|`|`n|dkr|j|j|j<|`|`n|d kr|j rt j |j j }n|j j jd }|jj|~|` |` ni|d kr=|j|jd <|`nD|d krt|jj|jj jd |`n td|dS(Nsdsml:s Illegal nameiRBsdirectory-entriesiR&RCREsutf-8R(R)soc-valuesUnknown tag %s(RGRHRIR:thandleRJRKRNRMRPR/t decodestringROtstripRLtappendRQRRR-(RRSRDR((s*/usr/lib64/python2.7/site-packages/dsml.pyt endElements:              " cCsN|jjdr%|j||_n%|jjdrJ|j||_ndS(NRRRO(t__dict__RRRRO(Rtch((s*/usr/lib64/python2.7/site-packages/dsml.pyt characterss ( R6R7R8RR@RARURZR](((s*/usr/lib64/python2.7/site-packages/dsml.pyR9s     #t DSMLParsercBs/eZdZdddZdZdZRS(s: Base class for a DSMLv1 parser. Applications should sub-class this class and override method handle() to implement something meaningful. Public class attributes: records_read Counter for records processed so far Arguments: input_file File-object to read the DSMLv1 input from ignored_attr_types Attributes with these attribute type names will be ignored. max_entries If non-zero specifies the maximum number of entries to be read from f. line_sep String used as line separator icCs||_||_ijttj|p*g|_d|_d|_ t j j |_ |j jt j jjd||}|j j|dS(Ni(NN(t _input_filet _max_entriesRRRRt_ignored_attr_typestNonet_current_recordt records_readR;R<t make_parsert_parsert setFeatureR=tfeature_namespacestsetContentHandler(Rt input_filetContentHandlerClasstignored_attr_typest max_entriestcontent_handler((s*/usr/lib64/python2.7/site-packages/dsml.pyR s  $   cOs*ddl}|j||j|dS(s} Process a single DSMLv1 entry record. This method should be implemented by applications using DSMLParser. iN(tpprint(RtargstkwargsRo((s*/usr/lib64/python2.7/site-packages/dsml.pyRVs  cCs|jj|jdS(s5 Continously read and parse DSML records N(RftparseR_(R((s*/usr/lib64/python2.7/site-packages/dsml.pyRr%sN(R6R7R8RbRRVRr(((s*/usr/lib64/python2.7/site-packages/dsml.pyR^s  (Rs&(Rs<(Rs"(Rs'(((R8t __version__RR/RR R txml.saxR;txml.sax.handlert ImportErrorR<R=R>R9R^(((s*/usr/lib64/python2.7/site-packages/dsml.pyt s  w T