b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / email /
Filename/usr/lib64/python2.6/email/feedparser.pyc
Size11.05 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed20-Jun-2019 19:45
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@sÈdZdgZddkZddklZddklZeid�Zeid�Zeid�Z eid�Z
eid �Z d
Z d Z
e�Zd efd
��YZddd��YZdS(sFeedParser - 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.
t
FeedParseriÿÿÿÿN(terrors(tmessages
|
|
s(
|
|
)s
(
|
|
)\Zs(^(From |[\041-\071\073-\176]{1,}:|[\t ])ts
tBufferedSubFilecBsqeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d �Z d
�Z d �Z
RS( skA 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.
cCs(d|_g|_g|_t|_dS(NR(t_partialt_linest _eofstacktFalset_closed(tself((s(/usr/lib64/python2.6/email/feedparser.pyt__init__3s   cCs|ii|�dS(N(Rtappend(R
tpred((s(/usr/lib64/python2.6/email/feedparser.pytpush_eof_matcher=scCs
|ii�S(N(Rtpop(R
((s(/usr/lib64/python2.6/email/feedparser.pytpop_eof_matcher@scCs)|ii|i�d|_t|_dS(NR(RR RtTrueR (R
((s(/usr/lib64/python2.6/email/feedparser.pytcloseCs cCst|ip|iodStS|ii�}x@|iddd�D](}||�o|ii|�dSqDW|S(NRiÿÿÿÿ(RR t NeedMoreDataRRR (R
tlinetateof((s(/usr/lib64/python2.6/email/feedparser.pytreadlineIs


 cCs(|tj pt�|ii|�dS(N(RtAssertionErrorRR (R
R((s(/usr/lib64/python2.6/email/feedparser.pyt
unreadline[scCsØ|i|d}|_ti|�}|i�|_|i o;|o4|did�o |id�|i�|_ng}xCtt|�d�D]+}|i||d||dd�q�W|i|�dS(s$Push some new data into this object.Riÿÿÿÿs
iþÿÿÿiiN( Rt NLCRE_cracktsplitRtendswithtrangetlenR t pushlines(R
tdatatpartstlinesti((s(/usr/lib64/python2.6/email/feedparser.pytpush`s& )cCs|ddd�|id*dS(Niÿÿÿÿi(R(R
R!((s(/usr/lib64/python2.6/email/feedparser.pyRwscCs|iS(N(R (R
((s(/usr/lib64/python2.6/email/feedparser.pyt is_closed{scCs|S(N((R
((s(/usr/lib64/python2.6/email/feedparser.pyt__iter__~scCs'|i�}|djo
t�n|S(NR(Rt
StopIteration(R
R((s(/usr/lib64/python2.6/email/feedparser.pytnext�s 

(t__name__t
__module__t__doc__R RRRRRR#RR$R%R'(((s(/usr/lib64/python2.6/email/feedparser.pyR+s
        cBseeZdZeid�Zd�Zd�Zd�Zd�Z d�Z
d�Z d�Z d �Z
RS(
sA feed-style parser of email.cCsO||_t�|_g|_|i�i|_d|_d|_ t
|_ dS(s@_factory is called with no arguments to create a new message objN( t_factoryRt_inputt _msgstackt _parsegenR't_parsetNonet_curt_lastRt _headersonly(R
R+((s(/usr/lib64/python2.6/email/feedparser.pyR �s     cCs
t|_dS(N(RR3(R
((s(/usr/lib64/python2.6/email/feedparser.pyt_set_headersonly�scCs|ii|�|i�dS(sPush more data into the parser.N(R,R#t _call_parse(R
R((s(/usr/lib64/python2.6/email/feedparser.pytfeed�scCs(y|i�Wntj
onXdS(N(R/R&(R
((s(/usr/lib64/python2.6/email/feedparser.pyR5�scCst|ii�|i�|i�}|i pt�|i�djo(|i� o|ii t
i ��n|S(s<Parse all remaining data and return the root message object.t multipart( R,RR5t _pop_messageR-Rtget_content_maintypet is_multiparttdefectsR Rt!MultipartInvariantViolationDefect(R
troot((s(/usr/lib64/python2.6/email/feedparser.pyR¥s

 cCs�|i�}|io'|ii�djo|id�n|io|idi|�n|ii|�||_||_dS(Nsmultipart/digestsmessage/rfc822iÿÿÿÿ(R+R1tget_content_typetset_default_typeR-tattachR R2(R
tmsg((s(/usr/lib64/python2.6/email/feedparser.pyt _new_message±s  
 cCs:|ii�}|io|id|_n
d|_|S(Niÿÿÿÿ(R-RR1R0(R
tretval((s(/usr/lib64/python2.6/email/feedparser.pyR8»s

 ccsñ|i�g}xp|iD]e}|tjo tVqnti|�p)ti|�p|ii|�nPn|i|�qW|i|�|i ozg}xSt
oK|ii �}|tjo tVq£n|djoPn|i|�q£W|i i
ti|��dS|i i�djoxût
oó|iiti�x.|i�D] }|tjo tVqTnPqTW|i�}|ii�x5t
o-|ii �}|tjo tVq�nPq�Wx5t
o-|ii �}|tjo tVqÌnPqÌW|djoPn|ii|�q-WdS|i i�djo@x.|i�D] }|tjo tVqPnPqPW|i�dS|i i�djoû|i i�}|djow|i iiti��g}x7|iD],}|tjo tVqÞn|i|�qÞW|i i
ti|��dSd|}tidti|�d�}t
} g}
t} xét
oá|ii �}|tjo tVqkn|djoPn|i|�} | or| id�o| id �} Pn| o|
o[|
d
}
t i!|
�}|o"|
t"|id �� |
d
<nti|
�|i _#nt} |ii|�qknx_t
oW|ii �}|tjo tVqon|i|�} | p|ii|�PqoqoW|ii|i�x.|i�D] }|tjo tVqînPqîW|i$i�djo~|i$i%}|djod|i$_%q
|dj oDt i!|�} | o*t"| id ��}|| |i$_%q¢q
nh|i$i&�}t'|t(�oHt i!|�} | o.|t"| id �� }|i$i
|�q
n|ii�|i�|i |_$qk| pt)�|
i|�qkW| o|i iiti*��|i i
ti|
��g}x*|iD]}|tjo tVq�q�q�Wti|�|i _%dS| o
dg}ng}x7|iD],}|tjo tVqþn|i|�qþW|oE|d }t+i|�}|o!|t"|id ��|d <qznti|�|i _%dSg}x7|iD],}|tjo tVq¤n|i|�q¤W|i i
ti|��dS( NRsmessage/delivery-statusRR7s--s(?P<sep>s4)(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$tendtlinesepiÿÿÿÿi(,RBR,RtheaderREtmatchtNLCRERR t_parse_headersR3RRR1t set_payloadt EMPTYSTRINGtjoinR>RR.R8RR9t get_boundaryR0R;RtNoBoundaryInMultipartDefecttretcompiletescapeRtgroupt NLCRE_eoltsearchRtpreambleR2tepiloguet get_payloadt
isinstancet
basestringRtStartBoundaryNotFoundDefectt NLCRE_bol(R
theadersRR!RCRAtboundaryt separatort
boundaryretcapturing_preambleRUREtmotlastlineteolmoRVRDtpayloadt firstlinetbolmo((s(/usr/lib64/python2.6/email/feedparser.pyR.Ãsh








 














"



 





 



%

c
Csd}g}xÓt|�D]Å\}}|ddjoD|p)ti|�}|iii|�qn|i|�qn|o:ti|�d id�}||i|<dg}}n|i d�o­|djoKt
i |�}|o|t |i
d�� }n|ii|�qqx|t |�djo|ii|�dSti|�}|iii|�qn|id�} | djo)ti|�}|iii|�qn|| }|| di�g}qW|o#ti|�id�|i|<ndS( NRis iÿÿÿÿs
sFrom it:(t enumerateRt#FirstHeaderLineIsContinuationDefectR1R;R RKRLtrstript
startswithRSRTRRRt set_unixfromR,RtMisplacedEnvelopeHeaderDefecttfindtMalformedHeaderDefecttlstrip(
R
R!t
lastheadert lastvaluetlinenoRtdefecttlhdrRaR"((s(/usr/lib64/python2.6/email/feedparser.pyRI¯sJ





(R(R)R*RtMessageR R4R6R5RRBR8R.RI(((s(/usr/lib64/python2.6/email/feedparser.pyR�s   
 ì((R*t__all__ROtemailRRRPRHR[RSRRFRKtNLtobjectRRR(((s(/usr/lib64/python2.6/email/feedparser.pyt<module>s   ^