AlkantarClanX12

Your IP : 18.118.144.98


Current Path : /proc/self/root/opt/alt/python33/lib64/python3.3/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python33/lib64/python3.3/__pycache__/quopri.cpython-33.pyc

�
��f�c@sdZddddgZdZdZdZdZyd	d
lmZmZWne	k
rjdZdZYnXdd�Zd
d�Zddd�Zdddd�Zddd�Zddd�Zdd�Zdd�Zdd�Zedkr�e�ndS(uHConversions to/from quoted-printable transport encoding as per RFC 1521.uencodeudecodeuencodestringudecodestrings=iLs0123456789ABCDEFsi(ua2b_qpub2a_qpcCs\t|t�st�|dkr%|S|dkr5|S|tkp[d|koXdknS(u�Decide whether a particular byte ordinal needs to be quoted.

    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
    quoted.  Note that line-ending tabs and spaces are always encoded, as per
    RFC 1521.
    s 	s_s s~(u
isinstanceubytesuAssertionErroruESCAPE(ucu	quotetabsuheader((u+/opt/alt/python33/lib64/python3.3/quopri.pyuneedsquotingsuneedsquotingcCsWt|t�r!t|�dks't�t|�}ttt|dt|df�S(uQuote a single character.ii(u
isinstanceubytesulenuAssertionErroruorduESCAPEuHEX(uc((u+/opt/alt/python33/lib64/python3.3/quopri.pyuquote$s'uquotec
Cs�tdk	rA|j�}t|d|d|�}|j|�dS|ddd�}d}x=|j�}|srPng}	d}
|d
d�dkr�|dd�}d}
nxm|D]e}t|f�}t|||�r�t|�}n|r|d	kr|	jd
�q�|	j|�q�W|dk	r6||�nt	j
|	�}xHt|�tkr�||dtd�dd�|tdd�}qHW|}q\|dk	r�||d|
�ndS(u�Read 'input', apply quoted-printable encoding, and write to 'output'.

    'input' and 'output' are files with readline() and write() methods.
    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
    quoted.  Note that line-ending tabs and spaces are always encoded, as per
    RFC 1521.
    The 'header' flag indicates whether we are encoding spaces as _ as per
    RFC 1522.
    u	quotetabsuheaderNs
cSs�|rN|dd�dkrN|j|dd�t|dd��|�n7|dkrt|jt|�|�n|j||�dS(Nis 	s.i����i����i����(uwriteuquote(usuoutputulineEnd((u+/opt/alt/python33/lib64/python3.3/quopri.pyuwrite=s
2uencode.<locals>.writesis s_ulineEnds=
i����i����(
ub2a_qpuNoneureaduwriteureadlineubytesuneedsquotinguquoteuappenduEMPTYSTRINGujoinulenuMAXLINESIZE(
uinputuoutputu	quotetabsuheaderudatauodatauwriteuprevlineulineuoutlineustrippeducuthisline((u+/opt/alt/python33/lib64/python3.3/quopri.pyuencode,s@

	

	cCsdtdk	r"t|d|d|�Sddlm}||�}|�}t||||�|j�S(Nu	quotetabsuheaderi(uBytesIO(ub2a_qpuNoneuiouBytesIOuencodeugetvalue(usu	quotetabsuheaderuBytesIOuinfpuoutfp((u+/opt/alt/python33/lib64/python3.3/quopri.pyuencodestringls	cCs�tdk	r;|j�}t|d|�}|j|�dSd}x)|j�}|sZPndt|�}}|dkr�||d|�dkr�d}	|d}x=|dkr�||d|�dkr�|d}q�Wnd}	xd||krI|||d�}
|
dkr/|r/|d	}|d}q�|
tkrR||
}|d}q�|d|krs|	rsd}	Pq�|d|kr�||dtkr�|t}|d
}q�|d
|kr2t||d|d
��r2t||d
|d��r2|tt	||d|d��f�}|d}q�||
}|d}q�W|	sD|j|d�d}qDqD|r�|j|�ndS(u�Read 'input', apply quoted-printable decoding, and write to 'output'.
    'input' and 'output' are files with readline() and write() methods.
    If 'header' is true, decode underscore as space (per RFC 1522).uheaderNsiis
s 	
s_s ii(
ua2b_qpuNoneureaduwriteureadlineulenuESCAPEuishexubytesuunhex(uinputuoutputuheaderudatauodataunewulineuiunupartialuc((u+/opt/alt/python33/lib64/python3.3/quopri.pyudecodewsR
&
)



$

L+

cCs^tdk	rt|d|�Sddlm}||�}|�}t||d|�|j�S(Nuheaderi(uBytesIO(ua2b_qpuNoneuiouBytesIOudecodeugetvalue(usuheaderuBytesIOuinfpuoutfp((u+/opt/alt/python33/lib64/python3.3/quopri.pyudecodestring�s	cCset|t�st�d|ko,dknpdd|koHdknpdd|kobdkSS(uDReturn true if the byte ordinal 'c' is a hexadecimal digit in ASCII.s0s9sasfsAsF(u
isinstanceubytesuAssertionError(uc((u+/opt/alt/python33/lib64/python3.3/quopri.pyuishex�suishexcCs�d}x�|D]�}t|f�}d|ko9dknrMtd�}nzd|koddknr|td�d}nKd	|ko�d
knr�td	�d}nd
s�tdt|���|dt|�|}q
W|S(u.Get the integer value of a hexadecimal number.is0s9u0sasfuai
sAsFunon-hex digit iF(ubytesuorduFalseuAssertionErrorurepr(usubitsucui((u+/opt/alt/python33/lib64/python3.3/quopri.pyuunhex�s
uunhexc)Cs;ddl}ddl}y)|j|jdd�d�\}}Wni|jk
r�}zF|j|_t|�td�td�td�|jd�WYdd}~XnXd}d}x>|D]6\}}|dkr�d}n|d	kr�d}q�q�W|r,|r,|j|_td
�|jd�n|s>dg}nd}	x�|D]�}
|
dkrl|jj	}n^yt
|
d�}WnHtk
r�}z(|jjd
|
|f�d}	wKWYdd}~XnXz6|r�t
||jj	�nt||jj	|�Wd|
dkr|j�nXqKW|	r7|j|	�ndS(Niiutdu"usage: quopri [-t | -d] [file] ...u-t: quote tabsu-d: decode; default encodeiu-tu-du -t and -d are mutually exclusiveu-urbu%s: can't open (%s)
(usysugetoptuargvuerrorustderrustdoutuprintuexitustdinubufferuopenuIOErroruwriteudecodeuencodeuclose(usysugetoptuoptsuargsumsgudecoutabsuouaustsufileufp((u+/opt/alt/python33/lib64/python3.3/quopri.pyumain�sT)



 	


umainu__main__NF(u__doc__u__all__uESCAPEuMAXLINESIZEuHEXuEMPTYSTRINGubinasciiua2b_qpub2a_qpuImportErroruNoneuneedsquotinguquoteuFalseuencodeuencodestringudecodeudecodestringuishexuunhexumainu__name__(((u+/opt/alt/python33/lib64/python3.3/quopri.pyu<module>s*
@+.