403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages//dsml.pyo
Ñò
ü?¡Ic
@sÃdZdZddkZddkZd„ZddddfZd
„Zddd„ƒYZyddkZ	ddk
Z	Wnej
on4Xde	ii
ifd„ƒYZddd„ƒYZdS(sø
dsml - generate and parse DSMLv1 data
(see http://www.oasis-open.org/committees/dsml/)

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

$Id: dsml.py,v 1.11 2008/12/17 10:11:54 stroeder Exp $

Python compability note:
Tested with Python 2.0+.
s0.5.3iÿÿÿÿNcCs%h}x|D]}d||<q
W|S(sN
  return a dictionary with all items of l being the keys of the dictionary
  N(tNone(tltdti((s(/usr/lib/python2.6/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_entitieststringtreplace(tstchartentity((s(/usr/lib/python2.6/site-packages/dsml.pytreplace_char"st
DSMLWritercBsGeZgddd„Zd„Zd„Zd„Zd„Zd„ZRS(ts    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(t_output_fileRtmapR
tlowert
_base64_attrst
_dsml_commentt_indent(tselftftbase64_attrstdsml_commenttindent((s(/usr/lib/python2.6/site-packages/dsml.pyt__init__)s		cCsT|io|iiti|ƒƒSyt|dƒWntj
odSXdSdS(Nsutf-8ii(Rthas_keyR
RtunicodetUnicodeError(Rt	attr_typet
attr_value((s(/usr/lib/python2.6/site-packages/dsml.pyt_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(RtwritetjoinRR(R((s(/usr/lib/python2.6/site-packages/dsml.pytwriteHeaderGs
 cCs+|iid|iƒ|iidƒdS(s
    Write the footer
    s%s</dsml:directory-entries>
s
</dsml:dsml>
N(RR$R(R((s(/usr/lib/python2.6/site-packages/dsml.pytwriteFooterWscCs|i||ƒS(N(twriteRecord(Rtdntentry((s(/usr/lib/python2.6/site-packages/dsml.pytunparse^sc	
Cs|iid|idt|ƒfƒ|id|idgƒƒ}|iid|idƒx/|D]'}|iid|id|fƒqgW|iid	|idƒ|iƒ}y|idƒ|idƒWntj
onX|iƒxû|D]ó}|iid
|id|fƒx®||D]¢}|i	||ƒ}|ot
i|ƒ}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(RR$RRtgettkeystremovet
ValueErrortsortR#tbase64tencodestring(	RR)R*t
objectclassestoct
attr_typesR!tattr_value_itemtneeds_base64_encoding((s(/usr/lib/python2.6/site-packages/dsml.pyR(asJ		%


!

(t__name__t
__module__RR#R&R'R+R((((s(/usr/lib/python2.6/site-packages/dsml.pyR's				t
DSMLv1HandlercBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(s*
    Content handler class for DSMLv1
    cCs#||_tiiii|ƒdS(N(t_parser_instancetxmltsaxthandlertContentHandlerR(Rtparser_instance((s(/usr/lib/python2.6/site-packages/dsml.pyR©s	cCsdS(N((R((s(/usr/lib/python2.6/site-packages/dsml.pyt
startDocument­scCsdS(N((R((s(/usr/lib/python2.6/site-packages/dsml.pytendDocument°scCs|d}|djonî|djo
d|_nÔ|djo|d|_h|_n­|djo#|did	ƒ|_g|_n}|d
jo.d|_|iddƒiƒd
j|_	nB|djo
g|_
n(|djo
d|_ntd|‚dS(Nitdsmlsdirectory-entriesiR*R)tattrtnamesutf-8tvalueRtencodingR3R,soc-valuesUnknown tag %s(
t_parsing_entriest_dnt_entrytencodet
_attr_typet_attr_valuest_attr_valueR.Rt_base64_encodingt_object_classest	_oc_valueR1(Rtraw_nametattrsRG((s(/usr/lib/python2.6/site-packages/dsml.pytstartElement³s&









	%



cCsz|d}|djon\|djo
d|_nB|djo)|ii|i|iƒ|`|`n|djo#|i|i|i<|`|`nÜ|djoa|ioti	|i
iƒƒ}n|i
iƒidƒ}|ii
|ƒ~|`
|`nn|d	jo|i|id
<|`nG|djo,|ii
|iiƒidƒƒ|`ntd|‚dS(
NiREsdirectory-entriesiR*RFRHsutf-8R,R-soc-valuesUnknown tag %s(RJR=thandleRKRLRORNRQR3tdecodestringRPtstripRMtappendRRRSR1(RRTRGR"((s(/usr/lib/python2.6/site-packages/dsml.pyt
endElementÌs8













"
cCsR|iidƒo|i||_n(|iidƒo|i||_ndS(NRSRP(t__dict__RRSRP(Rtch((s(/usr/lib/python2.6/site-packages/dsml.pyt
charactersïs
(	R:R;t__doc__RRCRDRVR[R^(((s(/usr/lib/python2.6/site-packages/dsml.pyR<¤s					#t
DSMLParsercBs/eZdZddd„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|_	t
iiƒ|_
|i
it
iiidƒ||ƒ}|i
i|ƒdS(sa
      Parameters:
      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
      iN(NN(t_input_filet_max_entriesRRR
Rt_ignored_attr_typesRt_current_recordtrecords_readR>R?tmake_parsert_parsert
setFeatureR@tfeature_namespacestsetContentHandler(Rt
input_filetContentHandlerClasstignored_attr_typestmax_entriestcontent_handler((s(/usr/lib/python2.6/site-packages/dsml.pyRs		"		cOs*ddk}|i|ƒ|i|ƒdS(s
      Process a single content DSMLv1 record. This method should be
      implemented by applications using DSMLParser.
      iÿÿÿÿN(tpprint(RtargstkwargsRp((s(/usr/lib/python2.6/site-packages/dsml.pyRWs
cCs|ii|iƒdS(s5
      Continously read and parse DSML records
      N(RgtparseRa(R((s(/usr/lib/python2.6/site-packages/dsml.pyRs(sN(R:R;R_RRRWRs(((s(/usr/lib/python2.6/site-packages/dsml.pyR`øs
		(Rs&amp;(Rs&lt;(Rs&quot;(Rs&apos;(((R_t__version__R
R3RR	RRtxml.saxR>txml.sax.handlertImportErrorR?R@RAR<R`(((s(/usr/lib/python2.6/site-packages/dsml.pyt<module>s			tT

Youez - 2016 - github.com/yon3zu
LinuXploit