;
Οβ"Ic               @   su   d  Z  d d g Z d d l Z d d l m Z d d l m Z d d l m Z Gd   d  Z	 Gd	   d e	  Z
 d S(
   u-   A parser of RFC 2822 and MIME email messages.u   Parseru   HeaderParseri    N(   u   StringIO(   u
   FeedParser(   u   Messagec             B   s/   |  Ee  Z d    Z d d  Z d d  Z d S(   c             O   s  t  |  d k o/ d | k o t d   n | d | d <n t  |  d k o/ d | k o t d   n | d | d <n t  |  d k o t d   n d | k o | d |  _ | d =n
 t |  _ d | k o t j d	 t d  | d =n | o t d
   n d S(   uΜ  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.
        i   u   _classu(   Multiple values for keyword arg '_class'i    i   u   strictu(   Multiple values for keyword arg 'strict'u   Too many argumentsu-   'strict' argument is deprecated (and ignored)u   Unexpected keyword argumentsN(   u   lenu	   TypeErroru   _classu   Messageu   warningsu   warnu   DeprecationWarning(   u   selfu   argsu   kws(    (    u)   /mit/python/lib/python3.0/email/parser.pyu   __init__   s(    		
c             C   s\   t  |  j  } | o | j   n x+ | j d  } | p Pn | j |  q' | j   S(   u\  Create a message structure from the data in a file.

        Reads all the data from the file and returns the root of the message
        structure.  Optional headersonly is a flag specifying whether to stop
        parsing after reading the headers or not.  The default is False,
        meaning it parses the entire contents of the file.
        i    (   u
   FeedParseru   _classu   _set_headersonlyu   readu   feedu   close(   u   selfu   fpu   headersonlyu
   feedparseru   data(    (    u)   /mit/python/lib/python3.0/email/parser.pyu   parse8   s    c             C   s   |  j  t |  d | S(   u-  Create a message structure from a string.

        Returns the root of the message structure.  Optional headersonly is a
        flag specifying whether to stop parsing after reading the headers or
        not.  The default is False, meaning it parses the entire contents of
        the file.
        u   headersonly(   u   parseu   StringIO(   u   selfu   textu   headersonly(    (    u)   /mit/python/lib/python3.0/email/parser.pyu   parsestrJ   s    NF(   u   __name__u
   __module__u   __init__u   Falseu   parseu   parsestr(   u
   __locals__(    (    u)   /mit/python/lib/python3.0/email/parser.pyu   Parser   s   
	&c             B   s&   |  Ee  Z d d   Z d d  Z d S(   c             C   s   t  j |  | d  S(   NT(   u   Parseru   parseu   True(   u   selfu   fpu   headersonly(    (    u)   /mit/python/lib/python3.0/email/parser.pyu   parseW   s    c             C   s   t  j |  | d  S(   NT(   u   Parseru   parsestru   True(   u   selfu   textu   headersonly(    (    u)   /mit/python/lib/python3.0/email/parser.pyu   parsestrZ   s    NT(   u   __name__u
   __module__u   Trueu   parseu   parsestr(   u
   __locals__(    (    u)   /mit/python/lib/python3.0/email/parser.pyu   HeaderParserV   s   
(   u   __doc__u   __all__u   warningsu   iou   StringIOu   email.feedparseru
   FeedParseru   email.messageu   Messageu   Parseru   HeaderParser(    (    (    u)   /mit/python/lib/python3.0/email/parser.pyu   <module>   s   E