/usr/lib/python2.6/email
NameSizeModeActions
mime/-0755rm
base64mime.py57920644editdlrm
base64mime.pyc53360644editdlrm
base64mime.pyo53360644editdlrm
charset.py157910644editdlrm
charset.pyc134140644editdlrm
charset.pyo133650644editdlrm
encoders.py23020644editdlrm
encoders.pyc24080644editdlrm
encoders.pyo24080644editdlrm
errors.py16280644editdlrm
errors.pyc34990644editdlrm
errors.pyo34990644editdlrm
feedparser.py206060644editdlrm
feedparser.pyc112680644editdlrm
feedparser.pyo111710644editdlrm
generator.py140620644editdlrm
generator.pyc103460644editdlrm
generator.pyo103460644editdlrm
header.py217380644editdlrm
header.pyc134900644editdlrm
header.pyo134210644editdlrm
iterators.py22020644editdlrm
iterators.pyc23830644editdlrm
iterators.pyo23830644editdlrm
message.py304460644editdlrm
message.pyc285610644editdlrm
message.pyo285610644editdlrm
parser.py33000644editdlrm
parser.pyc38370644editdlrm
parser.pyo38370644editdlrm
quoprimime.py108390644editdlrm
quoprimime.pyc89090644editdlrm
quoprimime.pyo89090644editdlrm
utils.py98190644editdlrm
utils.pyc90360644editdlrm
utils.pyo90360644editdlrm
_parseaddr.py149810644editdlrm
_parseaddr.pyc136490644editdlrm
_parseaddr.pyo136490644editdlrm
__init__.py28560644editdlrm
__init__.pyc28640644editdlrm
__init__.pyo28640644editdlrm
Edit: /usr/lib/python2.6/email/header.pyo (13421B)
Ñò «gc @s'dZdddgZddkZddkZddkZddkZddklZddk l Z dZ d Z d Z d d Zd Zd Ze dƒZe dƒZeideieiBeiBƒZeidƒZeiiZd„Zeed d„Zdfd„ƒYZd„Zd„Z dS(s+Header encoding and decoding functionality.tHeadert decode_headert make_headeriÿÿÿÿN(tHeaderParseError(tCharsets t u iuiLsus-asciisutf-8s§ =\? # literal =? (?P[^?]*?) # non-greedy up to the next ? is the charset \? # literal ? (?P[qb]) # either a "q" or a "b", case insensitive \? # literal ? (?P.*?) # non-greedy up to the next ?= is the encoded string \?= # literal ?= (?=[ \t]|$) # whitespace or the end of the string s[\041-\176]+:$c Cs<t|ƒ}ti|ƒp|d fgSg}d}xÿ|iƒD]ñ}ti|ƒp|i|d fƒqCnti|ƒ}x¯|o§|idƒiƒ}|oW|o9|ddd jo$|ddt |d f|dAppend a string to the MIME header. Optional charset, if given, should be a Charset instance or the name of a character set (which will be converted to a Charset instance). A value of None (the default) means that the charset given in the constructor is used. s may be a byte string or a Unicode string. If it is a byte string (i.e. isinstance(s, str) is true), then charset is the encoding of that byte string, and a UnicodeError will be raised if the string cannot be decoded with that charset. If s is a Unicode string, then charset is a hint specifying the character set of the characters in the string. In this case, when producing an RFC 2822 compliant header using RFC 2047 rules, the Unicode string will be encoded using the following charsets in order: us-ascii, the charset hint, utf-8. The first character set not to provoke a UnicodeError is used. Optional `errors' is passed as the third argument to any unicode() or ustr.encode() call. t8bitsus-asciiN(R R.R)RR t input_codecR>t output_codecR;R-tUTF8t UnicodeErrorR3R(R7R"R#R8tincodectustrtoutcodec((s"/usr/lib/python2.6/email/header.pyRâs*    cCs8|i|ƒ}|i|tƒ}|i|ƒ}||jo||fgS|djo||fgS|djo|i||||ƒS|t|ƒjo6|}|i|| tƒ} |i||tƒ} nt|||ƒ\} } |i| ƒ} |i| tƒ} | |fg} | |i| ||i |ƒS(NRHsus-ascii( t to_splittabletfrom_splittabletTruetencoded_header_lent _split_asciiR0tFalset _binsplitt_splitR6(R7R"R#R&t splitcharst splittableR%telentsplitpnttfirsttlastt fsplittabletfencodedtchunk((s"/usr/lib/python2.6/email/header.pyRWs$   cCs8t|||i|i|ƒ}t||gt|ƒƒS(N(RTR6R/tzipR0(R7R"R#tfirstlenRXtchunks((s"/usr/lib/python2.6/email/header.pyRTGsc Cs¹g}x–|D]Ž\}}|pq n|djp|idjo |}n|i|ƒ}|o|didƒo d}nd}t||||ƒq Wt|i}|i|ƒS(NiÿÿÿÿRR(R theader_encodingt header_encodetendswitht _max_appendtNLR/R@( R7t newchunksR&RcRR#R"textratjoiner((s"/usr/lib/python2.6/email/header.pyt_encode_chunksLs    s;, c Cs¨g}|i}d}x€|iD]u\}}||d}||idƒjo |}n||i||||ƒ7}|d\}} | i|ƒ}qW|i||ƒS(s‡Encode a message header into an RFC-compliant format. There are many issues involved in converting a given string for use in an email header. Only certain character sets are readable in most email clients, and as header strings can only contain a subset of 7-bit ASCII, care must be taken to properly convert and encode (with Base64 or quoted-printable) header strings. In addition, there is a 75-character length limit on any given encoded header field, so line-wrapping must be performed, even with double-byte character sets. This method will do its best to convert the string to the correct character set used in email, and encode and line wrap it safely with the appropriate scheme for that character set. If the given charset is not known or an error occurs during conversion, this function will return the header untouched. Optional splitchars is a string containing characters to split long ASCII lines on, in rough support of RFC 2822's `highest level syntactic breaks'. This doesn't affect RFC 2047 encoded lines. iiRiÿÿÿÿ(R5R3RSRWRl( R7RXRiR&tlastlenR"R#t targetlent lastchunkt lastcharset((s"/usr/lib/python2.6/email/header.pyR;os   N( t__name__t __module__R R:R<RDRFRGRRWRTRlR;(((s"/usr/lib/python2.6/email/header.pyR‰s3    7 .  #cCsg}|}x}|iƒD]o}|iƒ}t|ƒ|jo|i|ƒ|}qnx6|D]}||joPq_q_W|i|ƒ|}qtid|ƒ} |djo |} nd} | d} t| ƒ} t|idtƒƒ} g}d}xi| i|ƒD]X}|t dt|ƒdƒ| }t|ƒ}| }|djoI|oBt|ƒdjo/t i |dƒo|i|ƒ||7}q |||jo |o|i| i |ƒ| ƒn||joG|djo:t ||||dƒ}|i|d ƒ|dg}n |g}| t|dƒ}|}q |i|ƒ||7}q W|o|i| i |ƒƒqqW|S( Ns%s\s*s;,RRs iiiÿÿÿÿ(R tlstripR0RtretcompileR1R2RtmaxtfcretmatchR@RTtextend(R"RbtrestlenR(RXtlinestmaxlenRtchtcreteolRktjoinlentwslentthistlinelentparttcurlentpartlent onfirstlinetsubl((s"/usr/lib/python2.6/email/header.pyRT—sd          ! '      c Csµd}t|ƒ}xj||jo\||dd?}|i|| tƒ}|i|ƒ}||jo |}q|d}qW|i|| tƒ}|i||tƒ} || fS(Nii(R0RQRRRSRU( RYR#R&titjtmR`tchunklenR\R]((s"/usr/lib/python2.6/email/header.pyRVÝs    (!t__doc__t__all__RtRtemail.quoprimimeRtemail.base64mimet email.errorsRt email.charsetRRhRR=R2R?R4R-RKRutVERBOSEt IGNORECASEt MULTILINER RwRRgRR RRRTRV(((s"/usr/lib/python2.6/email/header.pyts8           9 ÿ F