ACC SHELL
Ñò
rÄMc
@ s' d Z d d d g Z d d k Z d d k Z d d k Z d d k Z d d k l Z d d k l
Z
d Z d Z d
Z
d d Z d Z d
Z e
d ƒ Z e
d ƒ Z e i d e i e i Be i Bƒ Z e i d ƒ Z e i i Z d „ Z e e d d „ Z d f d „ ƒ YZ d „ Z d „ Z d S( s+ Header encoding and decoding functionality.t Headert
decode_headert make_headeriÿÿÿÿN( t HeaderParseError( t Charsets
t u i u iL s us-asciis utf-8s§
=\? # literal =?
(?P<charset>[^?]*?) # non-greedy up to the next ? is the charset
\? # literal ?
(?P<encoding>[qb]) # either a "q" or a "b", case insensitive
\? # literal ?
(?P<encoded>.*?) # non-greedy up to the next ?= is the encoded string
\?= # literal ?=
(?=[ \t]|$) # whitespace or the end of the string
s [\041-\176]+:$c
C s< t | ƒ } t i | ƒ p | d f g Sg } d } xÿ| i ƒ D]ñ} t i | ƒ p | i | d f ƒ qC n t i | ƒ } x¯| o§| i d ƒ i ƒ } | oW | o9 | d d d j o$ | d d t | d f | d <qÿ | i | d f ƒ n | og } | d d !D] } | | i
ƒ q~ \ } } | d }
d } | d j o t i i
|
ƒ } nG | d j o9 y t i i |
ƒ } Wq³t i j
o
t ‚ q³Xn | d j o
|
} n | o= | d d | j o( | d d | | d d f | d <q%| i | | f ƒ n | d d 5q… WqC W| S(
sÒ Decode a message header value without converting charset.
Returns a list of (decoded_string, charset) pairs containing each of the
decoded parts of the header. Charset is None for non-encoded parts of the
header, otherwise a lower-case string containing the name of the character
set specified in the encoded string.
An email.errors.HeaderParseError may be raised when certain decoding error
occurs (e.g. a base64 decoding exception).
t i iÿÿÿÿi i t qt bi N( t strt ecret searcht Nonet
splitlinest appendt splitt popt stript SPACEt lowert emailt
quoprimimet
header_decodet
base64mimet decodet binasciit ErrorR ( t headert decodedt dect linet partst unenct _[1]t st charsett encodingt encoded( ( s"