PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  oYY@sdZddgZddlZddlmZddlmZddlmZddlm Z dd l m Z ej d Z ej d Zej d Zej d Zej d ZdZdZeZGdddeZGdddZGdddeZdS)aFeedParser - 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. FeedParserBytesFeedParserN)errors)message)compat32)deque)StringIOz | | z( | | )z ( | | )\Zz%^(From |[\041-\071\073-\176]*:|[\t ]) c@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ dS)BufferedSubFileakA 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. cCs4tdd|_t|_g|_d|_dS)Nnewliner F)r_partialr_lines _eofstack_closed)selfr)/opt/python35/lib/python3.5/feedparser.py__init__6s  zBufferedSubFile.__init__cCs|jj|dS)N)rappend)rZpredrrrpush_eof_matcherAsz BufferedSubFile.push_eof_matchercCs |jjS)N)rpop)rrrrpop_eof_matcherDszBufferedSubFile.pop_eof_matchercCsP|jjd|j|jj|jjd|jjd|_dS)NrT)r seek pushlines readlinestruncater)rrrrcloseGs  zBufferedSubFile.closecCsg|js|jrdStS|jj}x7t|jD]&}||r9|jj|dSq9W|S)Nr )rr NeedMoreDatapopleftreversedr appendleft)rlineZateofrrrreadlineOs   zBufferedSubFile.readlinecCs|jj|dS)N)rr!)rr"rrr unreadlineaszBufferedSubFile.unreadlinecCs|jj|d|kr,d|kr,dS|jjd|jj}|jjd|jj|djds|jj|j|j|dS)z$Push some new data into this object.r  Nr)r writerrrendswithrr)rdatapartsrrrpushfs zBufferedSubFile.pushcCs|jj|dS)N)rextend)rlinesrrrr{szBufferedSubFile.pushlinescCs|S)Nr)rrrr__iter__~szBufferedSubFile.__iter__cCs"|j}|dkrt|S)Nr )r# StopIteration)rr"rrr__next__s  zBufferedSubFile.__next__N)__name__ __module__ __qualname____doc__rrrrr#r$r,rr/r1rrrrr .s         r c@seZdZdZddeddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ dS)rzA feed-style parser of email.Npolicyc Cs||_d|_|dkrK|jtkr<tj|_qtj|_n;||_y|d|jWntk rd|_YnXt|_ g|_ |j j |_ d|_d|_d|_dS)a_factory is called with no arguments to create a new message obj The policy keyword specifies a policy object that controls a number of aspects of the parser's operation. The default policy maintains backward compatibility. FNr6T)r6_old_style_factoryrrZMessage_factoryZ EmailMessage TypeErrorr _input _msgstack _parsegenr1_parse_cur_last _headersonly)rr8r6rrrrs"         zFeedParser.__init__cCs d|_dS)NT)r@)rrrr_set_headersonlyszFeedParser._set_headersonlycCs|jj||jdS)zPush more data into the parser.N)r:r, _call_parse)rr*rrrfeedszFeedParser.feedc Cs'y|jWntk r"YnXdS)N)r=r0)rrrrrBs zFeedParser._call_parsecCse|jj|j|j}|jdkra|j ratj}|jj |||S)zget_content_typeZset_default_typer;Zattachrr?)rmsgrrr _new_messages    zFeedParser._new_messagecCs8|jj}|jr+|jd|_n d|_|S)Nr&r')r;rr>)rretvalrrrrEs   zFeedParser._pop_messageccs|jg}x|jD]x}|tkr4tVqtj|stj|stj}|jj |j ||jj |P|j |qW|j ||jrg}xA|jj}|tkrtVq|dkrP|j |qW|j jtj|dS|j jdkrx|jjtjx)|jD]}|tkretVqKPqKW|j}|jjx(|jj}|tkrtVqPqWx(|jj}|tkrtVqPqW|dkrP|jj |q+WdS|j jdkrMx)|jD]}|tkr:tVq Pq W|jdS|j jdkrv|j j}|dkrtj}|jj |j |g}x2|jD]'}|tkrtVq|j |qW|j jtj|dS|j jddjdkr:tj}|jj |j |d |}tjd tj |d } d } g} d } d } x|jj}|tkrtVq|dkrP| j|}|r|j!drd } |j!d} P| rf| rM| d}t"j#|}|r8|dt$|j!d | dz4)(?P--)?(?P[ \t]*)(?P\r\n|\r|\n)?$TFendlinesepr&r)rOrNrPr'r').rLr:rheaderREmatchNLCRErZ MissingHeaderBodySeparatorDefectr6rGr>r$r_parse_headersr@r#Z set_payload EMPTYSTRINGjoinrJrr<rErrFZ get_boundaryZNoBoundaryInMultipartDefectgetlowerZ-InvalidMultipartContentTransferEncodingDefectrecompileescapegroup NLCRE_eolsearchlenpreambler?epilogueZ_payload isinstancestrZStartBoundaryNotFoundDefectZCloseBoundaryNotFoundDefect NLCRE_bol)rZheadersr"rIr.rMrKboundaryZ separatorZ boundaryreZcapturing_preamblerbrRZclose_boundary_seenmoZlastlineZeolmorcrQZpayload firstlineZbolmorrrr<sf                         $                # zFeedParser._parsegenc Csd}g}xt|D]\}}|ddkrs|sctj|}|jj|j|q|j|q|r|jj|jj|dg}}|j drW|dkrt j |}|r|dt |j d }|jj|qnO|t |dkr2|jj|dStj|}|jjj|q|jd}|dkrtjd}|jjj|q|d|}|g}qW|r|jj|jj|dS)Nr rz zFrom r&:zMissing header name.) enumeraterZ#FirstHeaderLineIsContinuationDefectr6rGr>rZset_rawZheader_source_parse startswithr_r`rar^Z set_unixfromr:r$ZMisplacedEnvelopeHeaderDefectZdefectsfindZInvalidHeaderDefect) rr.Z lastheaderZ lastvaluelinenor"rIrhirrrrVsF      zFeedParser._parse_headers)r2r3r4r5rrrArCrBrrLrEr<rVrrrrrs !     cs(eZdZdZfddZS)rz(Like FeedParser, but feed accepts bytes.cs tj|jdddS)Nasciisurrogateescape)superrCdecode)rr*) __class__rrrCszBytesFeedParser.feed)r2r3r4r5rCrr)rtrrs )r5__all__r[ZemailrrZemail._policybaser collectionsriorr\rUrfr_Z NLCRE_crackrSrWNLobjectrr rrrrrrs&   [