JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrB YI~dX@sddgZddlZddlmZddlmZddlmZddlm Z e dZ e d Z e d Z e d Ze d Zd Zd ZeZGdddeZGdddZGdddeZdS) FeedParserBytesFeedParserN)errors)compat32)deque)StringIOz \r\n|\r|\nz (\r\n|\r|\n)z(\r\n|\r|\n)\Zz%^(From |[\041-\071\073-\176]*:|[\t ]) c@s\eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ dS)BufferedSubFilecCs$tdd|_t|_g|_d|_dS)Nr)newlineF)r_partialr_lines _eofstack_closed)selfr5/opt/alt/python37/lib64/python3.7/email/feedparser.py__init__5s zBufferedSubFile.__init__cCs|j|dS)N)rappend)rZpredrrrpush_eof_matcher@sz BufferedSubFile.push_eof_matchercCs |jS)N)rpop)rrrrpop_eof_matcherCszBufferedSubFile.pop_eof_matchercCs<|jd||j|jd|jd|_dS)NrT)r seek pushlines readlinestruncater)rrrrcloseFs    zBufferedSubFile.closecCsN|js|jrdStS|j}x*t|jD]}||r*|j|dSq*W|S)Nr)r r NeedMoreDatapopleftreversedr appendleft)rlineZateofrrrreadlineNs  zBufferedSubFile.readlinecCs|j|dS)N)r r )rr!rrr unreadline`szBufferedSubFile.unreadlinecCsx|j|d|kr d|kr dS|jd|j}|jd|j|ddsj|j|||dS)Nr  r)r writerrrendswithrr)rdatapartsrrrpushes     zBufferedSubFile.pushcCs|j|dS)N)r extend)rlinesrrrrzszBufferedSubFile.pushlinescCs|S)Nr)rrrr__iter__}szBufferedSubFile.__iter__cCs|}|dkrt|S)Nr)r" StopIteration)rr!rrr__next__szBufferedSubFile.__next__N) __name__ __module__ __qualname__rrrrr"r#r*rr-r/rrrrr -s r c@s\eZdZdedddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ dS)rN)policycCs||_d|_|dkr<|jdkr2ddlm}||_qn|j|_n2||_y||jdWntk rld|_YnXt|_g|_ | j |_ d|_ d|_d|_dS)NFr)Message)r3T)r3_old_style_factoryZmessage_factoryZ email.messager4_factory TypeErrorr _input _msgstack _parsegenr/_parse_cur_last _headersonly)rr6r3r4rrrrs$     zFeedParser.__init__cCs d|_dS)NT)r>)rrrr_set_headersonlyszFeedParser._set_headersonlycCs|j||dS)N)r8r* _call_parse)rr(rrrfeeds zFeedParser.feedcCs&y |Wntk r YnXdS)N)r;r.)rrrrr@s zFeedParser._call_parsecCsH|j||}|dkrD|sDt}|j |||S)N multipart) r8rr@ _pop_messageget_content_maintypeZ is_multipartrZ!MultipartInvariantViolationDefectr3 handle_defect)rrootdefectrrrrs  zFeedParser.closecCsn|jr|}n|j|jd}|jr<|jdkr<|d|jrR|jd||j|||_||_ dS)N)r3zmultipart/digestzmessage/rfc822r%) r5r6r3r<get_content_typeZset_default_typer9Zattachrr=)rmsgrrr _new_messages   zFeedParser._new_messagecCs(|j}|jr|jd|_nd|_|S)Nr%)r9rr<)rretvalrrrrCs  zFeedParser._pop_messageccs:|g}xb|jD]X}|tkr(tVqt|sbt|s`t}|j |j ||j |P| |qW| ||jrg}x2|j}|tkrtVq|dkrP| |qW|j t|dS|j dkrx|jtjx$|D]}|tkrtVqPqW|}|jx&|j}|tkrFtVq(Pq(Wx&|j}|tkrntVqPPqPW|dkrP|j |qWdS|j dkrx(|D]}|tkrtVqPqW|dS|j dkr|j }|dkrbt}|j |j |g}x.|jD]$}|tkrz4)(?P--)?(?P[ \t]*)(?P\r\n|\r|\n)?$TFendlinesepr%r).rJr8rheaderREmatchNLCRErZ MissingHeaderBodySeparatorDefectr3rEr<r#r_parse_headersr>r"Z set_payload EMPTYSTRINGjoinrHrr:rCrrDZ get_boundaryZNoBoundaryInMultipartDefectstrgetlowerZ-InvalidMultipartContentTransferEncodingDefectrecompileescapegroup NLCRE_eolsearchlenpreambler=epilogueZ_payload isinstanceZStartBoundaryNotFoundDefectZCloseBoundaryNotFoundDefect NLCRE_bol)rZheadersr!rGr,rKrIboundaryZ separatorZ boundaryreZcapturing_preambler`rOZclose_boundary_seenmoZlastlineZeolmorarNZpayload firstlineZbolmorrrr:sf                                                zFeedParser._parsegenc Cs\d}g}x2t|D]$\}}|ddkrV|sJt|}|j|j|q||q|rx|jj|j|dg}}| dr|dkrt |}|r|dt | d }|j|qn:|t |dkr|j|dSt|}|jj|q|d}|dkr(td}|jj|q|d|}|g}qW|rX|jj|j|dS)Nrrz zFrom :zMissing header name.) enumeraterZ#FirstHeaderLineIsContinuationDefectr3rEr<rZset_rawZheader_source_parse startswithr]r^r_r\Z set_unixfromr8r#ZMisplacedEnvelopeHeaderDefectZdefectsfindZInvalidHeaderDefect) rr,Z lastheaderZ lastvaluelinenor!rGreirrrrSsF              zFeedParser._parse_headers)N) r0r1r2rrr?rAr@rrJrCr:rSrrrrrs  ~cseZdZfddZZS)rcst|dddS)Nasciisurrogateescape)superrAdecode)rr() __class__rrrAszBytesFeedParser.feed)r0r1r2rA __classcell__rr)rrrrs)__all__rYZemailrZemail._policybaser collectionsriorrZrRrcr]Z NLCRE_crackrPrTNLobjectrr rrrrrrs&         [