|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21571/root/usr/lib64/python2.4/email/ |
Upload File : |
mò
‚=5Dc @ sü d Z d k Z d k l Z d k l Z d Z d Z d Z e i d ƒ Z
e i d ƒ Z d „ Z d
„ Z
d „ Z d „ Z d
d „ Z d „ Z d „ Z d e d e d „ Z e d e d „ Z e Z e Z e d „ Z e Z e Z d „ Z d „ Z d S( sF Quoted-printable content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'. It is used to
safely encode text that is in a character set similar to the 7-bit US ASCII
character set, but that includes some 8-bit characters that are normally not
allowed in email bodies or headers.
Quoted-printable is very space-inefficient for encoding binary files; use the
email.base64MIME module for that instead.
This module provides an interface to encode and decode both headers and bodies
with quoted-printable encoding.
RFC 2045 defines a method for including character set information in an
`encoded-word' in a header. This method is commonly used for 8-bit real names
in To:/From:/Cc: etc. fields, as well as Subject: lines.
This module does not do the line wrapping or end-of-line character
conversion necessary for proper internationalized headers; it only
does dumb encoding and decoding. To deal with the various line
wrapping issues, use the email.Header module.
N( s hexdigits( s fix_eolss
s
i s [^-a-zA-Z0-9!*+/ ]s [^ !-<>-~\t]c C s t t i | ƒ ƒ S( sB Return True if the character should be escaped with header quopri.N( t boolt hqret matcht c( R ( ( t( /usr/lib64/python2.4/email/quopriMIME.pyt header_quopri_check- s c C s t t i | ƒ ƒ S( s@ Return True if the character should be escaped with body quopri.N( R t bqreR R ( R ( ( R t body_quopri_check2 s c C sC d } x6 | D]. } t i | ƒ o | d 7} q
| d 7} q
W| S( s? Return the length of str when it is encoded with header quopri.i i i N( t countt sR R R ( R R R ( ( R t header_quopri_len7 s c C sC d } x6 | D]. } t i | ƒ o | d 7} q
| d 7} q
W| S( s= Return the length of str when it is encoded with body quopri.i i i N( R t strR R R ( R R R ( ( R t body_quopri_lenB s t c C sn | p | i | i ƒ ƒ nM t | d ƒ t | ƒ | j o | d c | | 7<n | i | i ƒ ƒ d S( Niÿÿÿÿ( t Lt appendR t lstript lent maxlent extra( R R R R ( ( R t _max_appendM s
!c C s t t | d d !d ƒ ƒ S( sD Turn a string in the form =AB to the ASCII character with value 0xabi i i N( t chrt intR ( R ( ( R t unquoteV s c C s d t | ƒ S( Ns =%02X( t ordR ( R ( ( R t quote[ s s
iso-8859-1iL c C s | p | Sn | p t | ƒ } n g } | d j o
d } n | t | ƒ t d } xm | D]e } | d j o t | d | ƒ qb t i
| ƒ p t | | | ƒ qb t | d t | ƒ | ƒ qb W| d }
|
i g } | D] } | d | | f qæ ~ ƒ S( s… Encode a single header line with quoted-printable (like) encoding.
Defined in RFC 2045, this `Q' encoding is similar to quoted-printable, but
used specifically for email header fields to allow charsets with mostly 7
bit characters (and some 8 bit) to remain more or less readable in non-RFC
2045 aware mail clients.
charset names the character set to use to encode the header. It defaults
to iso-8859-1.
The resulting string will be in the form:
"=?charset?q?I_f=E2rt_in_your_g=E8n=E8ral_dire=E7tion?\n
=?charset?q?Silly_=C8nglish_Kn=EEghts?="
with each line wrapped safely at, at most, maxlinelen characters (defaults
to 76 characters). If maxlinelen is None, the entire string is encoded in
one chunk with no splitting.
End-of-line characters (\r, \n, \r\n) will be automatically converted
to the canonical email line separator \r\n unless the keep_eols
parameter is True (the default is False).
Each line of the header will be terminated in the value of eol, which
defaults to "\n". Set this to "\r\n" if you are using the result of
this function directly in email.
i † i t t _s =%02Xs =?%s?q?%s?=N( t headert keep_eolst fix_eolst quotedt
maxlinelent Nonet max_encodedR t charsett MISC_LENR R R R R t eolt joinert joint _[1]t line( R R# R R R% R R) R R"