Edit File: quopri.cpython-38.opt-1.pyc
U ����@��da����������������������@���s����d�Z�ddddgZdZdZdZdZzd d lmZmZ�W�n�e k rP���dZdZY�nX�dd ��Z dd��Zddd�Zddd�Z ddd�Zddd�Zdd��Zdd��Zdd��Zedkr�e���dS�) zHConversions to/from quoted-printable transport encoding as per RFC 1521.�encode�decode�encodestring�decodestring����=�L���s���0123456789ABCDEF����������)�a2b_qp�b2a_qpNc�����������������C���s:���|�dkr|S�|�dkr|S�|�t�kp8d|���ko2dkn���S�)z�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. ���� ����_���� ����~)�ESCAPE)�c� quotetabs�header��r����+/opt/alt/python38/lib64/python3.8/quopri.py�needsquoting���s ����r���c�����������������C���s(���t�|��}�ttt|�d��t|�d��f��S�)zQuote a single character.����)�ordr����bytes�HEX�r���r���r���r����quote$���s����r���Fc����������� ������C���s2��t�dk r,|����}t�|||d�}|�|��dS�|dfdd�}d}|����}|sN�qg�} d} |dd��dkrv|dd��}d} |D�]D}t|f�}t|||�r�t|�}|r�|dkr�| �d ��qz| �|��qz|dk r�||��t� | �}t |�tk�r||dtd ���dd��|td �d��}q�|}q>|dk �r.||| d��dS�) av��Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are binary file objects. 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.N�r���r������� c�����������������S���sj���|�r<|�dd���dkr<|��|�d�d��t|�dd�����|���n*|�dkrX|��t|��|���n|��|�|���d�S�)N���r�������.)�writer���)�s�output�lineEndr���r���r���r ���;���s ����(zencode.<locals>.writer���r���r ���r�������s���= )r#���)r ����readr ����readliner���r���r����append�EMPTYSTRING�join�len�MAXLINESIZE) �inputr"���r���r����data�odatar ���Zprevline�lineZoutline�strippedr���Zthisliner���r���r���r���,���s>���� c�����������������C���sF���t�d�k rt�|�||d�S�ddlm}�||��}|��}t||||��|���S�)Nr���r�����BytesIO)r ����ior2���r����getvalue)r!���r���r���r2����infp�outfpr���r���r���r���j���s����c�����������������C���s���t�dk r*|����}t�||d�}|�|��dS�d}|����}|s>�q�dt|��}}|dkr�||d�|��dkr�d} |d�}|dkr�||d�|��dkr�|d�}qtnd} ||k��r�|||d���} | dkr�|r�|d �}|d�}q�| tkr�|| �}|d�}q�|d�|k�r| �sd} �q�q�|d�|k��rJ||d�|d ���tk�rJ|t�}|d �}q�|d �|k��r�t||d�|d �����r�t||d �|d�����r�|tt||d�|d����f��}|d�}q�|| �}|d�}q�| s.|�|d���d}q.|�r�|�|��dS�)z�Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are binary file objects. If 'header' is true, decode underscore as space (per RFC 1522).N�r���r���r���r$���r���s��� r���r �����������) r ���r%���r ���r&���r*���r����ishexr����unhex)r,���r"���r���r-���r.����newr/����i�n�partialr���r���r���r���r���u���sP���� �� � � �(� B"� � c�����������������C���sD���t�d�k rt�|�|d�S�ddlm}�||��}|��}t|||d��|���S�)Nr7���r���r1���)r ���r3���r2���r���r4���)r!���r���r2���r5���r6���r���r���r���r�������s����c�����������������C���sH���d|���kodkn��pFd|���ko*dkn��pFd|���koBdkS���S�)zDReturn true if the byte ordinal 'c' is a hexadecimal digit in ASCII.����0����9����a����f����A����Fr���r���r���r���r���r:�������s����r:���c�����������������C���s����d}|�D�]�}t�|f�}d|��kr*dkr8n�n td�}nLd|��krLdkr^n�ntd�d�}n&d |��krrd kr�n�ntd �d�}n�|d�t|�|��}q|S�)z.Get the integer value of a hexadecimal number.r���r@���rA����0rB���rC����a� ���rD���rE���r���)r���r���)r!����bitsr���r=���r���r���r���r;�������s���� r;���c������������������C���s���dd�l�}�dd�l}z|�|�jdd���d�\}}W�nV�|jk r��}�z6|�j|�_t|��td��td��td��|��d��W�5�d�}~X�Y�nX�d}d}|D�] \}}|dkr�d}|d kr�d}q�|r�|r�|�j|�_td ��|��d��|s�dg}d} |D�]�} | dkr�|�jj }nTzt | d�}W�nD�tk �rP�}�z$|�j�d | |f���d} W�Y��q�W�5�d�}~X�Y�nX�z*|�rjt||�jj ��nt||�jj |��W�5�| dk�r�|� ���X�q�| �r�|��| ��d�S�)Nr���r$���Ztdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encoder8���z-tz-dz -t and -d are mutually exclusive�-�rbz%s: can't open (%s) )�sys�getopt�argv�error�stderr�stdout�print�exit�stdin�buffer�open�OSErrorr ����closer���r���)rL���rM���Zopts�args�msgZdecoZtabs�orG����sts�file�fpr���r���r����main����sT������ � r_����__main__)F)FF)F)F)�__doc__�__all__r���r+���r���r(���Zbinasciir ���r ����ImportErrorr���r���r���r���r���r���r:���r;���r_����__name__r���r���r���r����<module>���s*��� > + .