Your IP : 3.144.40.90
��Yfa � @ s� d Z d d d d g Z d Z d Z d Z d Z y d d
l m Z m Z Wn e k
rj d Z d Z Yn Xd d
� Z
d d � Z d d d � Z d d d d � Z
d d d � Z d d d � Z d d � Z d d � Z d d � Z e d k r� e � d S)zHConversions to/from quoted-printable transport encoding as per RFC 1521.�encode�decode�encodestring�decodestring� =�L s 0123456789ABCDEF� � )�a2b_qp�b2a_qpNc C sG | d k r | S| d k r | S| t k pF d | k oC d k n 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.
s � _� � ~)�ESCAPE)�c� quotetabs�header� r �+/opt/alt/python35/lib64/python3.5/quopri.py�needsquoting s
r c C s0 t | � } t t t | d t | d f � S)zQuote a single character.� )�ordr �bytes�HEX)r r r r �quote$ s r Fc
C s� t d k rA | j � } t | d | d | �} | j | � d S| d d d � } d } x2| j � } | so Pg } d }
| d
d � d k r� | d d � } d }
xj | D]b } t | f � } t | | | � r� t | � } | r| d k r| j d
� q� | j | � q� W| d k r*| | � t j | � } xH t
| � t k r�| | d t d � d d �| t d d � } q<W| } q\ W| d k r�| | d |
�d S)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.Nr r s
c S s� | rN | d d � d k rN | j | d d � t | d d � � | � n7 | d k rt | j t | � | � n | j | | � d S)N� s � .���r r )�writer )�s�output�lineEndr r r r ; s
2zencode.<locals>.writer r r r r s =
r r )r
�readr �readliner r r �append�EMPTYSTRING�join�len�MAXLINESIZE)
�inputr r r �data�odatar Zprevline�lineZoutlineZstrippedr Zthisliner r r r , s@
c C sd t d k r"