-í
•‚É<c       s^   d  Z  d k l Z d k Z d k Z d Z d Z d f  d „  ƒ  YZ d e f d „  ƒ  YZ d S(	   s.   A parser of RFC 2822 and MIME email messages.
(   s   StringIONs    s   
s   Parserc      s5   e  i  d „ Z d „  Z d „  Z d „  Z d „  Z RS(   Nc    s   | |  _  d S(   sÌ  Parser of RFC 2822 and MIME email messages.

        Creates an in-memory object tree representing the email message, which
        can then be manipulated and turned over to a Generator to return the
        textual representation of the message.

        The string must be formatted as a block of RFC 2822 headers and header
        continuation lines, optionally preceeded by a `Unix-from' header.  The
        header block is terminated either by the end of the string or by a
        blank line.

        _class is the class to instantiate for new message objects when they
        must be created.  This class must have a constructor that can take
        zero arguments.  Default is Message.Message.
        N(   s   _classs   self(   s   selfs   _class(    (    s,   /usr/local/twc/lib/python2.2/email/Parser.pys   __init__ s     c    s4   |  i ƒ  } |  i | | ƒ |  i | | ƒ | Sd  S(   N(   s   selfs   _classs   roots   _parseheaderss   fps
   _parsebody(   s   selfs   fps   root(    (    s,   /usr/local/twc/lib/python2.2/email/Parser.pys   parse% s    c    s   |  i t | ƒ ƒ Sd  S(   N(   s   selfs   parses   StringIOs   text(   s   selfs   text(    (    s,   /usr/local/twc/lib/python2.2/email/Parser.pys   parsestr+ s    c    sj  d } g  } d } x3d o+| i ƒ  d  } | p | i ƒ  o Pn | d 7} | i d ƒ o4 | d j o | i	 | ƒ q n t
 i d ƒ ‚ n | d d j o/ | o t
 i d ƒ ‚ n | i | ƒ q n | i d	 ƒ } | d j  o t
 i d
 ƒ ‚ n | o t i | ƒ | | <n | |  } | | d i ƒ  g } q W| o t i | ƒ | | <n d  S(   Ns    i    i   iÿÿÿÿs   From s.   Unix-from in headers after first rfc822 headers    	s*   Continuation line seen before first headers   :s    Not a header, not a continuation(   s
   lastheaders	   lastvalues   linenos   fps   readlines   lines   strips
   startswiths	   containers   set_unixfroms   Errorss   HeaderParseErrors   appends   finds   is   NLs   joins   lstrip(   s   selfs	   containers   fps	   lastvalues   linenos   is   lines
   lastheader(    (    s,   /usr/local/twc/lib/python2.2/email/Parser.pys   _parseheaders. s8     

c    s  | i ƒ  } | i ƒ  d j } | o€t } } d | } | i
 ƒ  } | i | ƒ } | d j  o t i d | ƒ ‚ n | d j o | d | !} n | t | ƒ d | 7} | i d | d | ƒ }	 |	 d j  o t i d | ƒ ‚ n |	 t | ƒ d t | ƒ j  o | |	 t | ƒ d } n | o | d	 7} n | d 7} | | |	 !i d | ƒ } x< | D]4 }
 |  i |
 ƒ } | | _ | | _ | i | ƒ qiWnõ | i ƒ  d
 j ob g  } xH d o@ |  i ƒ  } |  i | | ƒ t | ƒ o Pn | i | ƒ qÁW| i | ƒ n€ | i ƒ  d j oY y |  i  | ƒ } Wn2 t i" j
 o# |  i ƒ  } |  i# | | ƒ n X| i | ƒ n | i | i
 ƒ  ƒ d  S(   Ns   multipart/digests   --i    s#   Couldn't find starting boundary: %si   s   
s&   Couldn't find terminating boundary: %si   s   

s   message/delivery-statuss   message($   s	   containers   get_boundarys   boundarys   get_types   isdigests   Nones   preambles   epilogues	   separators   fps   reads   payloads   finds   starts   Errorss   BoundaryErrors   lens
   terminators   splits   partss   parts   selfs   parsestrs   msgobjs   add_payloads   blockss   _classs   blockmsgs   _parseheaderss   appends   set_payloads   get_main_types   parses   msgs   HeaderParseErrors
   _parsebody(   s   selfs	   containers   fps   preambles   blockss   starts   blockmsgs   partss	   separators
   terminators   parts   isdigests   msgobjs   boundarys   epilogues   payloads   msg(    (    s,   /usr/local/twc/lib/python2.2/email/Parser.pys
   _parsebodyZ sZ    

!
 		 (   s   Messages   __init__s   parses   parsestrs   _parseheaderss
   _parsebody(    (    (    s,   /usr/local/twc/lib/python2.2/email/Parser.pys   Parser s
    			,s   HeaderParserc      s   d  Z  d „  Z RS(   s‹  A subclass of Parser, this one only meaningfully parses message headers.

    This class can be used if all you're interested in is the headers of a
    message.  While it consumes the message body, it does not parse it, but
    simply makes it available as a string payload.

    Parsing with this subclass can be considerably faster if all you're
    interested in is the message headers.
    c    s   | i | i ƒ  ƒ d  S(   N(   s	   containers   set_payloads   fps   read(   s   selfs	   containers   fp(    (    s,   /usr/local/twc/lib/python2.2/email/Parser.pys
   _parsebody® s    (   s   __doc__s
   _parsebody(    (    (    s,   /usr/local/twc/lib/python2.2/email/Parser.pys   HeaderParser¤ s   	 (	   s   __doc__s	   cStringIOs   StringIOs   Errorss   Messages   EMPTYSTRINGs   NLs   Parsers   HeaderParser(   s   HeaderParsers   Errorss   NLs   StringIOs   Messages   Parsers   EMPTYSTRING(    (    s,   /usr/local/twc/lib/python2.2/email/Parser.pys   ? s   		’