%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/
Upload File :
Create Path :
Current File : //opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyc

�
�ac@s�dZddlmZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddlm
Z
mZmZyddlZWnek
r�ddlZnXdZed�ZdZed�Zed	�Zd
�Zd�Zdefd
��YZdefd��YZiZdZ ej!�Z"d�Z#de%d�Z&dd�Z'dej(j)fd��YZ*e+ej,j-d�Z.dS(s
DNS rdata.i����(tBytesIONi(txrangetstring_typest	text_typei cCsRtj|�}djgtdt|�|�D]}||||!^q.�j�S(s{Convert a binary string into its hex encoding, broken up into chunks
    of chunksize characters separated by a space.
    t i(tbinasciithexlifytjointrangetlentdecode(tdatat	chunksizetlineti((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt_hexify(s	cCsRtj|�}djgtdt|�|�D]}||||!^q.�j�S(s~Convert a binary string into its base64 encoding, broken up into chunks
    of chunksize characters separated by a space.
    Ri(tbase64t	b64encodeRRR	R
(RRR
R((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt
_base64ify5s	s"\cCs�t|t�r|j�}nt|t�s<t|�}nd}xj|D]b}|tkrr|dt|�7}qI|dkr�|dkr�|t|�7}qI|d|7}qIW|S(s7Escape the characters in a quoted string which need it.ts\i is\%03d(t
isinstanceRtencodet	bytearrayt	__escapedtchr(tqstringttexttc((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt	_escapifyAs
cCsQxCtt|�ddd�D]%}||dkr|d|d!SqW|dd!S(s�Determine the index of greatest byte that isn't all zeros, and
    return the bitmap that contains all the bytes less than that index.
    ii����i(RR	(twhatR((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt_truncate_bitmapTs#tRdatacBs�eZdZddgZd�Zd�Zd�Zded�Z	ddd�Z
dd�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zeded��Zedd��Zded�ZRS(s#Base class for all DNS rdata types.trdclasstrdtypecCs||_||_dS(s�Initialize an rdata.

        *rdclass*, an ``int`` is the rdataclass of the Rdata.
        *rdtype*, an ``int`` is the rdatatype of the Rdata.
        N(R R!(tselfR R!((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__init__ds	cCs
tjjS(s�Return the type a Rdata covers.

        DNS SIG/RRSIG rdatas apply to a specific type; this type is
        returned by the covers() function.  If the rdata type is not
        SIG or RRSIG, dns.rdatatype.NONE is returned.  This is useful when
        creating rdatasets, allowing the rdataset to contain only RRSIGs
        of a particular type, e.g. RRSIG(NS).

        Returns an ``int``.
        (tdnst	rdatatypetNONE(R"((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pytcoversnscCs|j�d>|jBS(s�Return a 32-bit type value, the least significant 16 bits of
        which are the ordinary DNS type, and the upper 16 bits of which are
        the "covered" type, if any.

        Returns an ``int``.
        i(R'R!(R"((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pytextended_rdatatype|scKs
t�dS(sFConvert an rdata to text format.

        Returns a ``text``.
        N(tNotImplementedError(R"torigint
relativizetkw((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pytto_text�scCs
t�dS(sHConvert an rdata to wire format.

        Returns a ``binary``.
        N(R)(R"tfiletcompressR*((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pytto_wire�scCs&t�}|j|d|�|j�S(s�Convert rdata to a format suitable for digesting in hashes.  This
        is also the DNSSEC canonical form.

        Returns a ``binary``.
        N(RR0tNonetgetvalue(R"R*tf((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt
to_digestable�s	cCs&tjj|j|j|j��dS(s9Check that the current contents of the rdata's fields are
        valid.

        If you change an rdata by assigning to its fields,
        it is a good idea to call validate() when you are done making
        changes.

        Raises various exceptions if there are problems.

        Returns ``None``.
        N(R$trdatat	from_textR R!R-(R"((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pytvalidate�s
cCs�|j�}|tjjkr'd}ndtjj|�d}dtjj|j�dtjj|j�|dt|�dS(NRt(t)s<DNS Rs rdata: t>(	R'R$R%R&R-t
rdataclassR R!tstr(R"R'tctext((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__repr__�s
	cCs
|j�S(N(R-(R"((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__str__�scCsR|jtjj�}|jtjj�}||kr:dS||krJdSdSdS(s�Compare an rdata with another rdata of the same rdtype and
        rdclass.

        Return < 0 if self < other in the DNSSEC ordering, 0 if self
        == other, and > 0 if self > other.

        iii����N(R4R$tnametroot(R"tothertourttheir((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt_cmp�scCsNt|t�stS|j|jks7|j|jkr;tS|j|�dkS(Ni(RRtFalseR R!RE(R"RB((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__eq__�s
$cCsNt|t�stS|j|jks7|j|jkr;tS|j|�dkS(Ni(RRtTrueR R!RE(R"RB((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__ne__�s
$cCsKt|t�s4|j|jks4|j|jkr8tS|j|�dkS(Ni(RRR R!tNotImplementedRE(R"RB((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__lt__�s$cCsKt|t�s4|j|jks4|j|jkr8tS|j|�dkS(Ni(RRR R!RJRE(R"RB((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__le__�s$cCsKt|t�s4|j|jks4|j|jkr8tS|j|�dkS(Ni(RRR R!RJRE(R"RB((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__ge__�s$cCsKt|t�s4|j|jks4|j|jkr8tS|j|�dkS(Ni(RRR R!RJRE(R"RB((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__gt__�s$cCst|jtjj��S(N(thashR4R$R@RA(R"((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt__hash__�scCs
t�dS(N(R)(tclsR R!ttokR*R+((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR6�scCs
t�dS(N(R)(RQR R!twiretcurrenttrdlenR*((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt	from_wire�scCsdS(sWConvert any domain names in the rdata to the specified
        relativization.
        N((R"R*R+((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pytchoose_relativityRN(t__name__t
__module__t__doc__t	__slots__R#R'R(R1RHR-R0R4R7R>R?RERGRIRKRLRMRNRPtclassmethodR6RVRW(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR_s0	
		
		
									tGenericRdatacBseeZdZdgZd�Zded�Zeded��Z	ddd�Z
edd��ZRS(s�Generic Rdata Class

    This class is used for rdata types for which we have no better
    implementation.  It implements the DNS "unknown RRs" scheme.
    RcCs&tt|�j||�||_dS(N(tsuperR]R#R(R"R R!R((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR#scKsdt|j�t|j�S(Ns\# %d (R	RR(R"R*R+R,((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR-scCs�|j�}|j�s(|jdkr=tjjd��n|j�}g}x6|j�}|j�rnPn|j|jj	��qRWdj
|�}	tj|	�}
t
|
�|kr�tjjd��n||||
�S(Ns\#s$generic rdata does not start with \#Rs'generic rdata hex data has wrong length(tgett
is_identifiertvalueR$t	exceptiontSyntaxErrortget_intt
is_eol_or_eoftappendRRRt	unhexlifyR	(RQR R!RRR*R+ttokentlengthtchunksthexR((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR6s"		cCs|j|j�dS(N(twriteR(R"R.R/R*((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR0*scCs|||||||!�S(N((RQR R!RSRTRUR*((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyRV-sN(RXRYRZR[R#R1RHR-R\R6R0RV(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR]s		sdns.rdtypescCs;d�}tj||f�}tjj|�}tjj|�}|jdd�}|stjtjj|f�}|sy2|djt	||g��}|t||f<Wqt
k
ry8|djt	d|g��}|ttjj|f<Wqt
k
rd}qXqXqn|r1t||�}nt
}|S(NcSsTt�Ht|�}|jd�}x!|dD]}t||�}q-W|SWdQXdS(Nt.i(t_import_lockt
__import__tsplittgetattr(R@tmodt
componentstcomp((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt
import_module7st-t_RmtANY(t_rdata_modulesR_R$R;R-R%treplaceRxRt_module_prefixtImportErrorR1RqR](R R!RuRrtrdclass_texttrdtype_textRQ((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pytget_rdata_class5s.	

cCs�t|t�r$tjj|�}nt||�}|tkr�|j�}|j|�|j	�r�|j
dkr�tj|||||�}t|||j
dt|j
�|�Sn|j|||||�S(sNBuild an rdata object from text format.

    This function attempts to dynamically load a class which
    implements the specified rdata class and type.  If there is no
    class-and-type-specific implementation, the GenericRdata class
    is used.

    Once a class is chosen, its from_text() class method is called
    with the parameters to this function.

    If *tok* is a ``text``, then a tokenizer is created and the string
    is used as its input.

    *rdclass*, an ``int``, the rdataclass.

    *rdtype*, an ``int``, the rdatatype.

    *tok*, a ``dns.tokenizer.Tokenizer`` or a ``text``.

    *origin*, a ``dns.name.Name`` (or ``None``), the
    origin to use for relative names.

    *relativize*, a ``bool``.  If true, name will be relativized to
    the specified origin.

    Returns an instance of the chosen Rdata subclass.
    s\#i(RRR$t	tokenizert	TokenizerRR]R_tungetR`RaR6RVRR	(R R!RRR*R+RQRhR5((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR6Xs
	
cCs=tjj|�}t||�}|j||||||�S(s2Build an rdata object from wire format

    This function attempts to dynamically load a class which
    implements the specified rdata class and type.  If there is no
    class-and-type-specific implementation, the GenericRdata class
    is used.

    Once a class is chosen, its from_wire() class method is called
    with the parameters to this function.

    *rdclass*, an ``int``, the rdataclass.

    *rdtype*, an ``int``, the rdatatype.

    *wire*, a ``binary``, the wire-format message.

    *current*, an ``int``, the offset in wire of the beginning of
    the rdata.

    *rdlen*, an ``int``, the length of the wire-format rdata

    *origin*, a ``dns.name.Name`` (or ``None``).  If not ``None``,
    then names will be relativized to this origin.

    Returns an instance of the chosen Rdata subclass.
    (R$twiredatat
maybe_wrapRRV(R R!RSRTRUR*RQ((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyRV�stRdatatypeExistscBs$eZdZddhZddZRS(sDNS rdatatype already exists.R R!s8The rdata type with class {rdclass} and rdtype {rdtype} salready exists.(RXRYRZtsupp_kwargstfmt(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR��scCs]t||�}|tkr3td|d|��n|t||f<tjj|||�dS(s�Dynamically register a module to handle an rdatatype.

    *implementation*, a module implementing the type in the usual dnspython
    way.

    *rdtype*, an ``int``, the rdatatype to register.

    *rdtype_text*, a ``text``, the textual form of the rdatatype.

    *is_singleton*, a ``bool``, indicating if the type is a singleton (i.e.
    RRsets of the type can have only one member.)

    *rdclass*, the rdataclass of the type, or ``dns.rdataclass.ANY`` if
    it applies to all classes.
    R R!N(RR]R�RyR$R%t
register_type(timplementationR!R~tis_singletonR texisting_cls((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyR��s
(/RZtioRRRt
dns.exceptionR$tdns.nametdns.rdataclasst
dns.rdatatypet
dns.tokenizertdns.wiredatat_compatRRRt	threadingt
_threadingR|tdummy_threadingt_hex_chunksizeRt_base64_chunksizeRRRRRtobjectRR]RyR{tLockRnRR1RHR6RVRbtDNSExceptionR�RFR;tINR�(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdata.pyt<module>s@


		�,	#2!

Zerion Mini Shell 1.0