+
    i  c                   s    R t . ROtRt^LtRtRt ^ RIHtHt R t
R tRR ltRR	 ltRR
 ltRR ltR tR tR t]R8X  d
   ]! 4        R# R#   ]	 d    RtRt LBi ; i)zHConversions to/from quoted-printable transport encoding as per RFC 1521.s   =s   0123456789ABCDEF    )a2b_qpb2a_qpNc                s~    V R9   d   V# V R8X  d   V# V \         8H  ;'       g    RT u;8*  ;'       d    R8*  Mu '       * # )zDecide 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   &&&/usr/lib64/python3.14/quopri.pyneedsquotingr      s?     	F{Dy;11tq00D011r    c                s    \        V 4      p \        \        \        V ^,          ,          \        V ^,          ,          34      ,           # )zQuote a single character.)ordr   bytesHEXr      &r   quoter   "   s2     	AAE3q"u:s1R4y1222r    c                s   \         e1   V P                  4       p\        WBVR7      pVP                  V4       R# VR3R lpRpV P                  4       ;p'       d   . p	Rp
VR
R R8X  d   VRR
 pRp
V F_  p\	        V34      p\        WV4      '       d   \        V4      pV'       d   VR8X  d   V	P                  R4       KN  V	P                  V4       Ka  	  Ve	   V! V4       \        P                  V	4      p\        V4      \        8  d+   V! VR\        ^,
           RR	7       V\        ^,
          R pK>  TpK  Ve   V! VX
R	7       R# R# )ab  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   V '       d;   V RR R9   d1   VP                  V RR \        V RR 4      ,           V,           4       R# V R8X  d$   VP                  \        V 4      V,           4       R# VP                  W,           4       R# )   Nr   s   .)writer   )soutputlineEndr
   r   r   Zencode.<locals>.write9   sd     236!LL3B%"#-/'9:$YLLqG+,LL%r    r    r   r   s   =
)r   r   )r   readr   readliner   r   r   ZappendEMPTYSTRINGZjoinlenMAXLINESIZE)inputr   r   r	   dataodatar   ZprevlinelineZoutlineZstrippedr   Zthislines   &&&&         r   encoder$   *   s5    zz|t@U & H.."
"$
"99DHAqdAA&11!H!t)t$q!  (O ##G,(mk) (>KM*F;A/Hh) r    c                 s    \         e   \        WVR7      # ^ RIHp V! V 4      pV! 4       p\        WEW4       VP	                  4       # )Nr   BytesIO)r   ior&   r$   getvalue)r   r   r	   r&   infpoutfps   &&&   r   encodestringr+   e   s?    aV<<1:DIE
4	*>>r    c           	     s\   \         e0   V P                  4       p\        W2R7      pVP                  V4       R# RpV P                  4       ;p'       Ed   ^ \	        V4      rV^ 8  d>   Wh^,
          V R8X  d.   ^ q^,
          pV^ 8  d   Wh^,
          V R9   d   V^,
          pK"  M^p	Wx8  Ed>   WgV^,            p
V
R8X  d   V'       d   VR,           qW^,           pK4  V
\
        8w  d   WZ,           qW^,           pKQ  V^,           V8X  d   V	'       g   ^p	MV^,           V8  d3   Wg^,           V^,            \
        8X  d   V\
        ,           qW^,           pK  V^,           V8  dz   \        Wg^,           V^,            4      '       dY   \        Wg^,           V^,            4      '       d8   V\        \        Wg^,           V^,            4      34      ,           qW^,           pEK1  WZ,           qW^,           pEKD  V	'       d   EK  VP                  VR,           4       RpEK  V'       d   VP                  V4       R# R# )zRead '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   s    	r   r   )	r   r   r   r   r   r   ishexr   unhex)r    r   r	   r!   r"   Znewr#   iZnZpartialr   s   &&&        r   decoder0   p   s   
 zz|t+U
C.."
"$
"#d)1q5TA#a[E)GqSa%D1QK83aCGeqsADyVDjc!fgQ3q1'U1qTA#ac]f4Fl!A1qU4!AaC=11eD1QqSM6J6JE5c!A##7"9::!AgQ3qwLLu%C
S r    c                 s    \         e   \        WR7      # ^ RIHp V! V 4      pV! 4       p\        W4VR7       VP	                  4       # )Nr,   r%   )r   r'   r&   r0   r(   )r   r	   r&   r)   r*   s   &&   r   decodestringr1      s=    a''1:DIE
4v&>>r    c                s    RT u;8*  ;'       d    R8*  Mu ;'       g5    RT u;8*  ;'       d    R8*  Mu ;'       g    RT u;8*  ;'       d    R8*  # u # )zDReturn true if the byte ordinal 'c' is a hexadecimal digit in ASCII.   0   9   a   f   A   F r   r   r   r-   r-      sG     1FF 1 1T 1FFTQ5F5F$5FF5FFr    c                sB   ^ pV  F  p\        V34      pRTu;8:  d   R8:  d   M M\        R4      pMIRTu;8:  d   R8:  d   M M\        R4      ^
,
          pM$RTu;8:  d   R8:  d   M M\        R4      ^
,
          pV^,          \        V4      X,
          ,           pK  	  V# )	z.Get the integer value of a hexadecimal number.r2   r3   Z0r4   r5   ar6   r7   )r   r   )r   Zbitsr   r/   s   &   r   r.   r.      s    D1$K1CAQ$CAQ$D	"A Bw#a&1*%  Kr    c                  s0   ^ RI p ^ RIp VP                  V P                  R,          R4      w  r#RpRpX F  w  rxVR8X  d   R	pVR
8X  g   K  R	pK  	  V'       d6   V'       d.   V P                  V n        \        R4       V P                  ^4       X'       g   R.p^ p	V F  p
V
R8X  d   V P                  P                  pM \        V
R4      p V'       d!   \        WP
                  P                  4       M \        WP
                  P                  V4       V
R8w  d   VP                  4        K  K  	  V	'       d   V P                  V	4       R# R#   TP                   dZ   pT P                  T n        \        T4       \        R4       \        R4       \        R4       T P                  ^4        Rp?ELRp?ii ; i  \         d2   pT P                  P                  T
: RT: R24       ^p	 Rp?EKU  Rp?ii ; i  T
R8w  d   TP                  4        i i ; i)i    N:r   NNZtdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encodeFz-tTz-dz -t and -d are mutually exclusiveZ-Zrbz: can't open (z)
)sysgetoptZargvZerrorZstderrZstdoutZprintZexitZstdinZbufferZopenZOSErrorr   r0   r$   Zclose)r:   r;   ZoptsZargsZmsgZdecoZtabsZor9   ZstsZfileZfps               r   mainr<      s   ]]388B<6
 DD9Td9Td  ZZ
01
C3;!!B$%
	r::,,-r::,,d3s{
 ! $  I << ZZ
c
23*+0  

  D#!FG s{
 sC   %E  F<G;A G;F9 AF44F9<G8%G33G8;HZ__main__)r$   r0   r+   r1   )F)FF)Z__doc__Z__all__r   r   r   r   Zbinasciir   r   ZImportErrorr   r   r$   r+   r0   r1   r-   r.   r<   Z__name__r8   r    r   <module>r=      s    N ?	'239*v'RG
$*\ zF y  FFs   A AA