-í
ë¶<c       sk   d  Z  d k l 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   StringIO(   s   ListTypeNs    s   
s   Parserc      s;   t  Z 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/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/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/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/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 | ƒ } xg | D]_ } |  i | ƒ } |	 | _ | | _ t | i ƒ  t ƒ o | i | g ƒ n | 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
   isinstances   get_payloads   ListTypes   set_payloads   add_payloads   blockss   _classs   blockmsgs   _parseheaderss   appends   get_main_types   parses   msgs   HeaderParseErrors
   _parsebody(   s   selfs	   containers   fps   blockss   msgs   parts
   terminators   msgobjs   blockmsgs   preambles   payloads   epilogues   starts   partss	   separators   isdigests   boundary(    (    s"   /usr/lib/python2.2/email/Parser.pys
   _parsebody[ s^    

!
 		 (   s   __name__s
   __module__s   Messages   __init__s   parses   parsestrs   _parseheaderss
   _parsebody(    (    (    s"   /usr/lib/python2.2/email/Parser.pys   Parser s
   			,s   HeaderParserc      s   t  Z 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/lib/python2.2/email/Parser.pys
   _parsebody³ s    (   s   __name__s
   __module__s   __doc__s
   _parsebody(    (    (    s"   /usr/lib/python2.2/email/Parser.pys   HeaderParser© s   	 (   s   __doc__s	   cStringIOs   StringIOs   typess   ListTypes   Errorss   Messages   EMPTYSTRINGs   NLs   Parsers   HeaderParser(   s   HeaderParsers   Errorss   NLs   StringIOs   ListTypes   Messages   Parsers   EMPTYSTRING(    (    s"   /usr/lib/python2.2/email/Parser.pys   ? s   		–