a
´ib ã @ s® d Z g d¢ZdZdZdZdZzddlmZmZ W n e yJ dZdZY n0 d d
„ Z
dd„ Zddd„Zddd„Z
ddd„Zd dd„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 sH t | tƒsJ ‚| dv r|S | dkr&|S | tkpFd| ko@dkn 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.
ó ó _ó ó ~)Ú
isinstanceÚbytesÚESCAPE)ÚcÚ quotetabsÚheader© r ú/usr/lib64/python3.9/quopri.pyÚneedsquoting s r c C sB t | tƒrt| ƒdksJ ‚t| ƒ} ttt| d t| d fƒ S )zQuote a single character.é é )r r ÚlenÚordr ÚHEX©r r r r Úquote$ s r Fc
C s2 t dur,| ¡ }t |||d�}| |¡ dS |dfdd„}d}| ¡ }|sN�qg } d}
|dd… dkrv|dd… }d}
|D ]D}t|fƒ}t|||ƒrœt|ƒ}|r´|dkr´| d ¡ qz| |¡ qz|durÐ||ƒ t | ¡}t
|ƒtk�r||dtd
… dd� |td
d… }qÚ|}q>|du�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 … dv r<| | d d… t| dd … ƒ | ¡ n*| dkrX| t| ƒ| ¡ n| | | ¡ d S )Néÿÿÿÿr ó .)Úwriter )ÚsÚoutputÚlineEndr r r r# ; s
(zencode.