• File: quopri.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/__pycache__/quopri.cpython-37.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 5.63 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

Mja@sdZddddgZdZdZdZdZyd	d
lmZmZWne	k
rPdZdZYnXdd
Z
ddZdddZdddZ
dddZdddZddZddZddZedkredS) zHConversions to/from quoted-printable transport encoding as per RFC 1521.encodedecodeencodestringdecodestring=Ls0123456789ABCDEF)a2b_qpb2a_qpNcCsHt|tst|dkr|S|dkr&|S|tkpFd|ko@dknS)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 	_ ~)
isinstancebytesAssertionErrorESCAPE)c	quotetabsheaderr+/opt/alt/python37/lib64/python3.7/quopri.pyneedsquotingsrcCsBt|trt|dkstt|}ttt|dt|dfS)zQuote a single character.)rrlenrordrHEX)rrrrquote$srFc
Cs<tdk	r,|}t|||d}||dS|dfdd}d}x|}|sNPg}	d}
|dddkrv|dd}d}
xL|D]D}t|f}t|||rt|}|r|dkr|	d	q||	|q|W|dk	r||t	|	}x:t
|tkr||dtd
dd|td
d}qW|}q@W|dk	r8|||
ddS)
avRead '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)rr
cSsj|r<|dddkr<||ddt|dd|n*|dkrX|t||n|||dS)Ns 	.)writer)soutputlineEndrrrr!;s
(zencode.<locals>.writerrrrrs=
)r$)r
readr!readlinerrrappendEMPTYSTRINGjoinrMAXLINESIZE)
inputr#rrdataodatar!ZprevlinelineZoutlinestrippedrZthislinerrrr,s@	





cCsFtdk	rt|||dSddlm}||}|}t|||||S)N)rrr)BytesIO)r
ior0rgetvalue)r"rrr0infpoutfprrrrjscCstdk	r*|}t||d}||dSd}x|}|s@Pdt|}}|dkr||d|dkrd}	|d}x.|dkr||d|dkr|d}qxWnd}	x*||kr|||d}
|
dkr|r|d	}|d}q|
tkr||
}|d}q|d|kr|	sd}	Pq|d|krR||d|d
tkrR|t}|d
}q|d
|krt||d|d
rt||d
|dr|tt||d|df}|d}q||
}|d}qW|	s2||dd}q2W|r||dS)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)rrrrrs 	
rr)	r	r%r!r&rrishexrunhex)r+r#rr,r-newr.inpartialrrrrrusR


(
B"
cCsDtdk	rt||dSddlm}||}|}t|||d|S)N)rr)r0)r	r1r0rr2)r"rr0r3r4rrrrscCsVt|tstd|ko dknpTd|ko8dknpTd|koPdkSS)zDReturn true if the byte ordinal 'c' is a hexadecimal digit in ASCII.09afAF)rrr)rrrrr7sr7cCsd}x|D]}t|f}d|kr,dkr:nn
td}n`d|krNdkr`nntdd}n:d	|krtd
krnntd	d}ndstdt||d
t||}q
W|S)z.Get the integer value of a hexadecimal number.rr=r>0r?r@a
rArBFznon-hex digit r)rrrrepr)r"bitsrr:rrrr8s


r8cCsddl}ddl}y||jddd\}}WnV|jk
r}z6|j|_t|tdtdtd|dWdd}~XYnXd}d}x(|D] \}}|dkrd}|d	krd}qW|r|r|j|_td
|d|sdg}d}	x|D]}
|
dkr|jj	}nNyt
|
d}Wn>tk
rR}z|jd
|
|fd}	wWdd}~XYnXz*|rlt
||jj	nt||jj	|Wd|
dkr|XqW|	r||	dS)NrrZtdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encoder5z-tz-dz -t and -d are mutually exclusive-rbz%s: can't open (%s)
)sysgetoptargverrorstderrstdoutprintexitstdinbufferopenOSErrorr!rrclose)rJrKZoptsargsmsgZdecoZtabsorDstsfilefprrrmainsT




r]__main__)F)FF)F)F)__doc____all__rr*rr(Zbinasciir	r
ImportErrorrrrrrrr7r8r]__name__rrrr<module>s*

>

+
.