%PDF- %PDF-
Mini Shell

Mini Shell

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

�
�ac@sdZddlmZddlZddlZddlZddlZddlm	Z	m
Z
mZied6ed6ed6ed	6ed
6ed6ed6Z
ied6Zd
ZdZdZdZdZdZdZdejjfd��YZdefd��YZdefd��YZdS(sTokenize DNS master file formati����(tStringIONi(tlongt	text_typetbinary_typet s	s
t;t(t)t"iiiiiitUngetBufferFullcBseZdZRS(sDAn attempt was made to unget a token when the unget buffer was full.(t__name__t
__module__t__doc__(((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyR	0stTokencBs�eZdZded�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�ZRS(s�A DNS master file format token.

    ttype: The token type
    value: The token value
    has_escape: Does the token value contain escapes?
    tcCs||_||_||_dS(sInitialize a token instance.N(tttypetvaluet
has_escape(tselfRRR((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt__init__<s		cCs
|jtkS(N(RtEOF(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytis_eofCscCs
|jtkS(N(RtEOL(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytis_eolFscCs
|jtkS(N(Rt
WHITESPACE(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt
is_whitespaceIscCs
|jtkS(N(Rt
IDENTIFIER(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt
is_identifierLscCs
|jtkS(N(Rt
QUOTED_STRING(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytis_quoted_stringOscCs
|jtkS(N(RtCOMMENT(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt
is_commentRscCs
|jtkS(N(Rt	DELIMITER(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytis_delimiterUscCs|jtkp|jtkS(N(RRR(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt
is_eol_or_eofXscCs5t|t�stS|j|jko4|j|jkS(N(t
isinstanceR
tFalseRR(Rtother((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt__eq__[scCs5t|t�stS|j|jkp4|j|jkS(N(R#R
tTrueRR(RR%((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt__ne__ascCsd|j|jfS(Ns%d "%s"(RR(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt__str__gscCsu|js
|Sd}t|j�}d}x:||krd|j|}|d7}|dkrW||krutjj�n|j|}|d7}|j�rW||kr�tjj�n|j|}|d7}||kr�tjj�n|j|}|d7}|j�o|j�s#tjj�ntt	|�dt	|�dt	|��}qWn||7}q+Wt
|j|�S(NRiis\idi
(RtlenRtdnst	exceptiont
UnexpectedEndtisdigittSyntaxErrortchrtintR
R(Rt	unescapedtltitctc2tc3((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytunescapejs6	







4cCsdS(Ni((R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt__len__�scCst|j|jf�S(N(titerRR(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt__iter__�scCs0|dkr|jS|dkr&|jSt�dS(Nii(RRt
IndexError(RR4((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt__getitem__�s
(R
RRR$RRRRRRRR!R"R&R(R)R8R9R;R=(((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyR
4s"														t	TokenizercBs�eZdZejdd�Zd�Zd�Zd�Z	d�Z
eed�Zd�Z
d�ZeZd	�Zd
d�Zd�Zd
d
�Zd�Zdd�Zdd�Zdd�Zd�Zd�ZRS(sdA DNS master file format tokenizer.

    A token object is basically a (type, value) tuple.  The valid
    types are EOF, EOL, WHITESPACE, IDENTIFIER, QUOTED_STRING,
    COMMENT, and DELIMITER.

    file: The file to tokenize

    ungotten_char: The most recently ungotten character, or None.

    ungotten_token: The most recently ungotten token, or None.

    multiline: The current multiline level.  This value is increased
    by one every time a '(' delimiter is read, and decreased by one every time
    a ')' delimiter is read.

    quoting: This variable is true if the tokenizer is currently
    reading a quoted string.

    eof: This variable is true if the tokenizer has encountered EOF.

    delimiters: The current delimiter dictionary.

    line_number: The current line number

    filename: A filename that will be returned by the where() method.
    cCs�t|t�r3t|�}|dkr�d}q�nft|t�rlt|j��}|dkr�d}q�n-|dkr�|tjkr�d}q�d}n||_d|_	d|_
d|_t|_
t|_t|_d|_||_dS(sEInitialize a tokenizer instance.

        f: The file to tokenize.  The default is sys.stdin.
        This parameter may also be a string, in which case the tokenizer
        will take its input from the contents of the string.

        filename: the name of the filename that the where() method
        will return.
        s<string>s<stdin>s<file>iiN(R#RRtNoneRtdecodetsyststdintfilet
ungotten_chartungotten_tokent	multilineR$tquotingteoft_DELIMITERSt
delimiterstline_numbertfilename(RtfRL((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyR�s*										cCs�|jdkrl|jr!d}q~|jjd�}|dkrKt|_q~|dkr~|jd7_q~n|j}d|_|S(s%Read a character from input.
        Ris
N(RDR?RHRCtreadR'RK(RR5((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt	_get_char�s				cCs|j|jfS(s�Return the current location in the input.

        Returns a (string, int) tuple.  The first item is the filename of
        the input, the second is the current line number.
        (RLRK(R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytwhere�scCs%|jdk	rt�n||_dS(s%Unget a character.

        The unget buffer for characters is only one character large; it is
        an error to try to unget a character when the unget buffer is not
        empty.

        c: the character to unget
        raises UngetBufferFull: there is already an ungotten char
        N(RDR?R	(RR5((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt_unget_char�s	cCsod}xbtrj|j�}|dkr]|dkr]|dksI|jr]|j|�|Sn|d7}q	WdS(sFConsume input until a non-whitespace character is encountered.

        The non-whitespace character is then ungotten, and the number of
        whitespace characters consumed is returned.

        If the tokenizer is in multiline mode, then newlines are whitespace.

        Returns the number of characters skipped.
        iRs	s
iN(R'RORFRQ(RtskippedR5((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytskip_whitespaces	
c
Cs�|jdk	rZ|j}d|_|j�r:|rW|SqZ|j�rS|rW|SqZ|Sn|j�}|r�|dkr�ttd�Sd}t}t}x�t	rA|j
�}|dks�||jkr�|dkr�|jr�t
jj�n|dkr�|tkr�|dkr.|jd7_|j�q�q�|dkrw|jdkrXt
jj�n|jd8_|j�q�q�|dkr�|js�t	|_t|_t}q�q�t|_t|_|j�q�q�|dkr�ttd�S|d	kr�x6|j
�}|dks|dkrPn||7}q�W|rJ|j|�tt|�S|dkr~|jrtt
jjd
��ntt�S|jr�|j�d}q�q�ttd�Sq�|}t}n
|j|�Png|jr�|dkr�|j
�}|dkr	t
jj�n|j�r�|j
�}|dkr<t
jj�n|j
�}	|dkrct
jj�n|j�ox|	j�s�t
jj�ntt|�dt|�d
t|	��}q�q4|dkr4t
jjd��q4nR|dkr4||7}t	}|j
�}|dks"|dkr4t
jj�q4n||7}q�W|dkr�|tkr�|jrxt
jjd
��nt}nt|||�S(s�Get the next token.

        want_leading: If True, return a WHITESPACE token if the
        first character read is whitespace.  The default is False.

        want_comment: If True, return a COMMENT token if the
        first token read is a comment.  The default is False.

        Raises dns.exception.UnexpectedEnd: input ended prematurely

        Raises dns.exception.SyntaxError: input was badly formed

        Returns a Token.
        iRRRiRRs
Rsunbalanced parenthesess\idi
snewline in quoted stringN(RER?RRRSR
RRR$R'RORJRGR+R,R-RRFR/t_QUOTING_DELIMITERSRIRRQRRR R.R0R1(
Rtwant_leadingtwant_commentttokenRRRRR5R6R7((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytgets�		
	

					



		
	
	
	4
		cCs%|jdk	rt�n||_dS(sUnget a token.

        The unget buffer for tokens is only one token large; it is
        an error to try to unget a token when the unget buffer is not
        empty.

        token: the token to unget

        Raises UngetBufferFull: there is already an ungotten token
        N(RER?R	(RRW((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytunget�s	cCs%|j�}|j�r!t�n|S(sHReturn the next item in an iteration.

        Returns a Token.
        (RXRt
StopIteration(RRW((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytnext�s	cCs|S(N((R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyR;�si
cCsg|j�j�}|j�s3tjjd��n|jj�sWtjjd��nt|j|�S(s�Read the next token and interpret it as an integer.

        Raises dns.exception.SyntaxError if not an integer.

        Returns an int.
        sexpecting an identifiersexpecting an integer(	RXR8RR+R,R/RR.R1(RtbaseRW((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytget_int�scCsA|j�}|dks$|dkr=tjjd|��n|S(s�Read the next token and interpret it as an 8-bit unsigned
        integer.

        Raises dns.exception.SyntaxError if not an 8-bit unsigned integer.

        Returns an int.
        ii�s#%d is not an unsigned 8-bit integer(R]R+R,R/(RR((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt	get_uint8�s
		cCsl|jd|�}|dks*|dkrh|dkrOtjjd|��qhtjjd|��n|S(s�Read the next token and interpret it as a 16-bit unsigned
        integer.

        Raises dns.exception.SyntaxError if not a 16-bit unsigned integer.

        Returns an int.
        R\ii��is*%o is not an octal unsigned 16-bit integers$%d is not an unsigned 16-bit integer(R]R+R,R/(RR\R((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt
get_uint16�s			cCs�|j�j�}|j�s3tjjd��n|jj�sWtjjd��nt|j�}|dks�|td�kr�tjjd|��n|S(s�Read the next token and interpret it as a 32-bit unsigned
        integer.

        Raises dns.exception.SyntaxError if not a 32-bit unsigned integer.

        Returns an int.
        sexpecting an identifiersexpecting an integeriIs$%d is not an unsigned 32-bit integer(	RXR8RR+R,R/RR.R(RRWR((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt
get_uint32�s		cCsF|j�j�}|j�p'|j�s?tjjd��n|jS(s�Read the next token and interpret it as a string.

        Raises dns.exception.SyntaxError if not a string.

        Returns a string.
        sexpecting a string(RXR8RRR+R,R/R(RtoriginRW((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt
get_string�scCs:|j�j�}|j�s3tjjd��n|jS(s�Read the next token, which should be an identifier.

        Raises dns.exception.SyntaxError if not an identifier.

        Returns a string.
        sexpecting an identifier(RXR8RR+R,R/R(RRaRW((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytget_identifierscCsC|j�}|j�s-tjjd��ntjj|j|�S(s�Read the next token and interpret it as a DNS name.

        Raises dns.exception.SyntaxError if not a name.

        Returns a dns.name.Name.
        sexpecting an identifier(RXRR+R,R/tnamet	from_textR(RRaRW((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytget_namescCsD|j�}|j�s=tjjd|j|jf��n|jS(snRead the next token and raise an exception if it isn't EOL or
        EOF.

        Returns a string.
        s expected EOL or EOF, got %d "%s"(RXR"R+R,R/RR(RRW((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytget_eol!s		cCsF|j�j�}|j�s3tjjd��ntjj|j�S(s�Read the next token and interpret it as a DNS TTL.

        Raises dns.exception.SyntaxError or dns.ttl.BadTTL if not an
        identifier or badly formed.

        Returns an int.
        sexpecting an identifier(	RXR8RR+R,R/tttlReR(RRW((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pytget_ttl/s	N(R
RRRARBR?RRORPRQRSR$RXRYR[t__next__R;R]R^R_R`RbRcRfRgRi(((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyR>�s(#					}					


	(RtioRRAt
dns.exceptionR+tdns.nametdns.ttlt_compatRRRR'RIRTRRRRRRR R,tDNSExceptionR	tobjectR
R>(((sB/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/tokenizer.pyt<module>s2

d

Zerion Mini Shell 1.0