• File: feedparser.cpython-37.opt-2.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/email/__pycache__/feedparser.cpython-37.opt-2.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 8.6 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

YI~dX@sddgZddlZddlmZddlmZddlmZddlm	Z	e
dZe
d	Ze
d
Z
e
d	Ze
dZd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
ZddZd
dZ	ddZ
ddZddZ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
-sr
c@s\eZdZdedddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZ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]$}|tkr<tVq$||q$W|j
t|dSt|j
dddkrt}|j	|j
|d|}t d	t!|d
}	d}
g}d}d}
x|j}|tkrtVq|dkrP|	|}|r|"d
r d}
|"d}P|
r|rn|d}t#$|}|r`|dt%|"d|d<t||j
_&d}
|j|qxB|j}|tkrtVq|	|}|s|j|PqW|j|	jx(|D]}|tkrtVqPqW|j'dkrf|j'j(}|dkr*d|j'_(n:|dk	rt#$|}|rt%|"d}|d||j'_(nD|j'j)}t*|trt#$|}|r|dt%|"d}||j'_)|j||j
|_'n
||qW|
rBt+}|j	|j
||j
t|g}x$|jD]}|tkrtVqqWt||j
_(dS|
sdt,}|j	|j
|dS|rrdg}ng}x.|jD]$}|tkrtVq~||q~W|r|d}t-|}|r|t%|"dd|d<t||j
_(dSg}x.|jD]$}|tkrtVq||qW|j
t|dS)Nrzmessage/delivery-statusmessagerBzcontent-transfer-encoding8bit)Z7bitrMZbinaryz--z(?P<sep>z4)(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$TFendlinesepr%r).rJr8rheaderREmatchNLCRErZ MissingHeaderBodySeparatorDefectr3rEr<r#r_parse_headersr>r"Zset_payloadEMPTYSTRINGjoinrHrr: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._policybasercollectionsriorrZrRrcr]ZNLCRE_crackrPrTNLobjectrr
rrrrrr<module>s&




[