|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21571/root/usr/lib64/python2.4/email/ |
Upload File : |
mò
‚=5Dc @ s¶ d Z d k Z d k l Z d k l Z e i d ƒ Z e i d ƒ Z e i d ƒ Z e i d ƒ Z e i d ƒ Z
d Z d Z e
ƒ Z d
e
f d „ ƒ YZ d f 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 throw 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.
N( s Errors( s Messages
|
|
s (
|
|
)s (
|
|
)$s( ^(From |[\041-\071\073-\176]{1,}:|[\t ])t s
t BufferedSubFilec B sq t 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( d | _ g | _ g | _ t | _ d S( NR ( t selft _partialt _linest _eofstackt Falset _closed( R ( ( t( /usr/lib64/python2.4/email/FeedParser.pyt __init__0 s c C s | i i | ƒ d S( N( R R t appendt pred( R R ( ( R t push_eof_matcher: s c C s
| i i ƒ S( N( R R t pop( R ( ( R t pop_eof_matcher= s c C s) | i i | i ƒ d | _ t | _ d S( NR ( R R R
R t TrueR ( R ( ( R t close@ s c C s} | i p | i o d Sn t Sn | i i ƒ } xC | i d d d … D]+ } | | ƒ o | i i | ƒ d SqJ qJ W| S( NR iÿÿÿÿ( R R R t NeedMoreDataR
t lineR t ateofR
( R R R ( ( R t readlineF s
c C s | i i | ƒ d S( N( R R R
R ( R R ( ( R t
unreadlineX s c C s’ | i | d } | _ t i | ƒ } | i ƒ | _ g } xC t t | ƒ d ƒ D]+ } | i | | d | | d d ƒ qR W| i | ƒ d S( s$ Push some new data into this object.R i i N(
R R t datat NLCRE_crackt splitt partsR
t linest ranget lent iR
t pushlines( R R R R R ( ( R t push] s )c C s | d d d … | i d *d S( Niÿÿÿÿi ( R R R ( R R ( ( R R p s c C s | i S( N( R R ( R ( ( R t is_closedt s c C s | S( N( R ( R ( ( R t __iter__w s c C s' | i ƒ } | d j o
t ‚ n | S( NR ( R R R t
StopIteration( R R ( ( R t nextz s
( t __name__t
__module__t __doc__R R R R R R R R R R! R# ( ( ( R R ( s
t
FeedParserc B se t Z d Z e i d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z d „ Z RS(
s A feed-style parser of email.c C sO | | _ t ƒ | _ g | _ | i ƒ i | _ d | _ d | _
t | _ d S( s@ _factory is called with no arguments to create a new message objN(
t _factoryR R t _inputt _msgstackt _parsegenR# t _parset Nonet _curt _lastR t _headersonly( R R( ( ( R R … s c C s
t | _ d S( N( R R R0 ( R ( ( R t _set_headersonly s c C s | i i | ƒ | i ƒ d S( s Push more data into the parser.N( R R) R R t _call_parse( R R ( ( R t feed“ s c C s( y | i ƒ Wn t j
o n Xd S( N( R R, R"