KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21571/root/usr/lib64/python2.4/site-packages/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21571/root/usr/lib64/python2.4/site-packages/dsml.pyc
mò
Âká@c@s·dZdZdkZdkZd„ZddddfZd„Zd
fd„ƒYZydkZ	dk
Z	Wnej
on4Xde	ii
ifd„ƒYZdfd„ƒYZdS(s*
dsml - generate and parse DSMLv1 data
(see http://www.oasis-open.org/committees/dsml/)
written by Michael Stroeder <michael@stroeder.com>

See http://python-ldap.sourceforge.net for details.

$Id: dsml.py,v 1.9 2004/06/17 13:52:07 stroeder Exp $

Python compability note:
Tested with Python 2.0+.
s0.5.2NcCs%h}x|D]}d||<q
W|S(sN
  return a dictionary with all items of l being the keys of the dictionary
  N(tdtltitNone(RRR((t*/usr/lib64/python2.4/site-packages/dsml.pyt	list_dictst&s&amp;t<s&lt;t"s&quot;t's&apos;cCs0x)tD]!\}}ti|||ƒ}qW|S(N(tspecial_entitiestchartentitytstringtreplacets(RRR((Rtreplace_char#st
DSMLWritercBsGtZgddd„Zd„Zd„Zd„Zd„Zd„ZRS(	Nts    cCs:||_ttti|ƒƒ|_||_
||_dS(s
    Parameters:
    f
          File object for output.
    base64_attrs
          Attribute types to be base64-encoded.
    dsml_comment
          Text placed in comment lines behind <dsml:dsml>.
    indent
          String used for indentiation of next nested level.
    N(
tftselft_output_fileRtmapR
tlowertbase64_attrst
_base64_attrstdsml_commentt
_dsml_commenttindentt_indent(RRRRR((Rt__init__*s

		cCsZ|io|iiti|ƒƒSn0yt|dƒWntj
odSnXdSdS(Nsutf-8ii(	RRthas_keyR
Rt	attr_typetunicodet
attr_valuetUnicodeError(RR R"((Rt_needs_base64_encoding=s
	cCsŒ|iididddd|igƒƒ|ioR|iid|iƒ|iid|i|ifƒ|iid|iƒnd	S(
s
    Write the header
    s
s&<?xml version="1.0" encoding="UTF-8"?>sD<!DOCTYPE root PUBLIC "dsml.dtd" "http://www.dsml.org/1.0/dsml.dtd">s1<dsml:dsml xmlns:dsml="http://www.dsml.org/DSML">s%s<dsml:directory-entries>
s%s<!--
s%s%s
s%s-->
N(RRtwritetjoinRR(R((RtwriteHeaderHs,
 cCs+|iid|iƒ|iidƒdS(s
    Write the footer
    s%s</dsml:directory-entries>
s
</dsml:dsml>
N(RRR%R(R((RtwriteFooterXscCs|i||ƒS(N(RtwriteRecordtdntentry(RR*R+((Rtunparse_sc	Cs|iid|idt|ƒfƒ|id|idgƒƒ}|iid|idƒx/|D]'}|iid|id|fƒqgW|iid	|idƒ|i
ƒ}y|idƒ|idƒWnt
j
onX|iƒxû|D]ó}|iid
|id|fƒx®||D]¢}|i||ƒ}|oti|ƒ}n
t|ƒ}|iid|idd|fƒ|iid
|id|fƒ|iid|idfƒq1W|iid|idƒqÿW|iid|idƒdS(s„
    dn
          string-representation of distinguished name
    entry
          dictionary holding the LDAP entry {attr:data}
    s%s<dsml:entry dn="%s">
itobjectclasstobjectClasss%s<dsml:objectclass>
is$%s<dsml:oc-value>%s</dsml:oc-value>
is%s</dsml:objectclass>
s%s<dsml:attr name="%s">
s%s<dsml:value%s>
s encoding="base64"s%s%s
is%s</dsml:value>
s%s</dsml:attr>
s%s</dsml:entry>
N(RRR%RRR*R+tgett
objectclassestoctkeyst
attr_typestremovet
ValueErrortsortR tattr_value_itemR$tneeds_base64_encodingtbase64tencodestring(	RR*R+R3R7R1R R0R8((RR)bs<'%


!%!"(t__name__t
__module__RR$R'R(R,R)(((RR(s				t
DSMLv1HandlercBsDtZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s*
    Content handler class for DSMLv1
    cCs#||_tiiii|ƒdS(N(tparser_instanceRt_parser_instancetxmltsaxthandlertContentHandlerR(RR>((RRªs	cCsdS(N((R((Rt
startDocument®scCsdS(N((R((RtendDocument±scCs&|idƒp
td‚|d}|djonî|djo
d|_nÔ|djo|d|_h|_n­|d	jo#|d
i	dƒ|_
g|_n}|djo.d|_|i
d
dƒiƒdj|_nB|djo
g|_n(|djo
d|_ntd|‚dS(NRsIllegal nameitdsmlsdirectory-entriesiR+R*tattrtnamesutf-8tvaluetencodingR9R-soc-valuesUnknown tag %s(traw_namet
startswithtAssertionErrorRHRt_parsing_entriestattrst_dnt_entrytencodet
_attr_typet_attr_valuest_attr_valueR/Rt_base64_encodingt_object_classest	_oc_valueR5(RRKRORH((RtstartElement´s(









	%



cCs”|idƒp
td‚|d}|djon\|djo
d|_nB|djo)|ii|i|i	ƒ|`|`	n|djo#|i
|i	|i<|`|`
nÜ|d	joa|iot
i|iiƒƒ}n|iiƒid
ƒ}|i
i|ƒ~|`|`nn|djo|i|i	d<|`nG|d
jo,|ii|iiƒid
ƒƒ|`ntd|‚dS(Nsdsml:sIllegal nameiRFsdirectory-entriesiR+RGRIsutf-8R-R.soc-valuesUnknown tag %s(RKRLRMRHRRNR?thandleRPRQRTRSRVR9tdecodestringRUtstripR"RRtappendRWRXR5(RRKRHR"((Rt
endElementÍs:













"
cCsR|iidƒo|i||_n(|iidƒo|i||_ndS(NRXRU(Rt__dict__RRXtchRU(RR`((Rt
charactersðs(	R;R<t__doc__RRDRERYR^Ra(((RR=¥s					#t
DSMLParsercBs/tZdZedd„Zd„Zd„ZRS(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
    icCs”||_||_ttti|pgƒƒ|_
d|_d|_
tiiƒ|_|iitiiidƒ||ƒ}|ii|ƒdS(s_
      Parameters:
      input_file
          File-object to read the LDIF 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
      iN(NN(t
input_fileRt_input_filetmax_entriest_max_entriesRRR
Rtignored_attr_typest_ignored_attr_typesRt_current_recordtrecords_readR@RAtmake_parsert_parsert
setFeatureRBtfeature_namespacestContentHandlerClasstcontent_handlertsetContentHandler(RRdRpRhRfRq((RRs		"		cOs'dk}|i|ƒ|i|ƒdS(s}
      Process a single content LDIF record. This method should be
      implemented by applications using LDIFParser.
      N(tpprinttargstkwargs(RRtRuRs((RRZ s	
cCs|ii|iƒdS(s5
      Continously read and parse DSML records
      N(RRmtparseRe(R((RRv)s(R;R<RbRRRZRv(((RRcùs		(Rs&amp;(Rs&lt;(Rs&quot;(R	s&apos;(Rbt__version__R
R9RR
RRtxml.saxR@txml.sax.handlertImportErrorRARBRCR=Rc(
R@RR
R9R=R
RcRRwR((Rt?s	
	tT

Anon7 - 2021