%PDF- %PDF-
Direktori : /lib64/python2.7/email/ |
Current File : //lib64/python2.7/email/feedparser.pyc |
� {fc @ s� d Z d g Z d d l Z d d l m Z d d l m Z e j d � Z e j d � Z e j d � Z e j d � Z e j d � Z d Z d Z e � Z d e f d � � YZ d d d � � YZ d S( s FeedParser - An email feed parser. The feed parser implements an interface for incrementally parsing an email message, line by line. This has advantages for certain applications, such as those reading email messages off a socket. FeedParser.feed() is the primary interface for pushing new data into the parser. It returns when there's nothing more it can do with the available data. When you have no more data to push into the parser, call .close(). This completes the parsing and returns the root message object. The other advantage of this parser is that it will never raise a parsing exception. Instead, when it finds something unexpected, it adds a 'defect' to the current message. Defects are just instances that live on the message object's .defects attribute. t FeedParseri����N( t errors( t messages | | s ( | | )s ( | | )\Zs( ^(From |[\041-\071\073-\176]{1,}:|[\t ])t s t BufferedSubFilec B sq e Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( sk A file-ish object that can have new data loaded into it. You can also push and pop line-matching predicates onto a stack. When the current predicate matches the current line, a false EOF response (i.e. empty string) is returned instead. This lets the parser adhere to a simple abstraction -- it parses until EOF closes the current message. c C s( g | _ g | _ g | _ t | _ d S( N( t _partialt _linest _eofstackt Falset _closed( t self( ( s( /usr/lib64/python2.7/email/feedparser.pyt __init__3 s c C s | j j | � d S( N( R t append( R t pred( ( s( /usr/lib64/python2.7/email/feedparser.pyt push_eof_matcher= s c C s | j j � S( N( R t pop( R ( ( s( /usr/lib64/python2.7/email/feedparser.pyt pop_eof_matcher@ s c C s8 | j d j | j � j t � � g | _ t | _ d S( NR ( t pushlinest joinR t splitlinest TrueR ( R ( ( s( /usr/lib64/python2.7/email/feedparser.pyt closeC s " c C sn | j s | j r d St S| j j � } x>