Psyduck - 可達鴨 之 鴨力山大2


Server : LiteSpeed
System : Linux premium217.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User : alloknri ( 880)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /opt/alt/python37/lib64/python3.7/email/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/alt/python37/lib64/python3.7/email/__pycache__/feedparser.cpython-37.pyc
B

� f�X�@s�dZddgZddlZddlmZddlmZddlmZddl	m
Z
e�d	�Ze�d
�Z
e�d�Ze�d
�Ze�d�Zd
ZdZe�ZGdd�de�ZGdd�d�ZGdd�de�ZdS)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.
�
FeedParser�BytesFeedParser�N)�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`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
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.
    cCs$tdd�|_t�|_g|_d|_dS)Nr)�newlineF)r�_partialr�_lines�	_eofstack�_closed)�self�r�5/opt/alt/python37/lib64/python3.7/email/feedparser.py�__init__5szBufferedSubFile.__init__cCs|j�|�dS)N)r�append)rZpredrrr�push_eof_matcher@sz BufferedSubFile.push_eof_matchercCs
|j��S)N)r�pop)rrrr�pop_eof_matcherCszBufferedSubFile.pop_eof_matchercCs<|j�d�|�|j���|j�d�|j��d|_dS)NrT)r�seek�	pushlines�	readlines�truncater)rrrr�closeFs

zBufferedSubFile.closecCsN|js|jrdStS|j��}x*t|j�D]}||�r*|j�|�dSq*W|S)Nr)r
r�NeedMoreData�popleft�reversedr�
appendleft)r�lineZateofrrr�readlineNs
zBufferedSubFile.readlinecCs|tk	st�|j�|�dS)N)r�AssertionErrorr
r )rr!rrr�
unreadline`szBufferedSubFile.unreadlinecCsx|j�|�d|kr d|kr dS|j�d�|j��}|j�d�|j��|d�d�sj|j�|���|�|�dS)z$Push some new data into this object.r	�
Nr���)r�writerrr�endswithrr)r�data�partsrrr�pushes

zBufferedSubFile.pushcCs|j�|�dS)N)r
�extend)r�linesrrrrzszBufferedSubFile.pushlinescCs|S)Nr)rrrr�__iter__}szBufferedSubFile.__iter__cCs|��}|dkrt�|S)Nr)r"�
StopIteration)rr!rrr�__next__�szBufferedSubFile.__next__N)�__name__�
__module__�__qualname__�__doc__rrrrr"r$r+rr.r0rrrrr
-sr
c@s`eZdZdZded�dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rzA feed-style parser of email.N)�policycCs�||_d|_|dkr<|jdkr2ddlm}||_qn|j|_n2||_y||jd�Wntk
rld|_YnXt�|_g|_	|�
�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.

        FNr)�Message)r5T)r5�_old_style_factoryZmessage_factoryZ
email.messager6�_factory�	TypeErrorr
�_input�	_msgstack�	_parsegenr0�_parse�_cur�_last�_headersonly)rr8r5r6rrrr�s$

zFeedParser.__init__cCs
d|_dS)NT)r@)rrrr�_set_headersonly�szFeedParser._set_headersonlycCs|j�|�|��dS)zPush more data into the parser.N)r:r+�_call_parse)rr)rrr�feed�szFeedParser.feedcCs&y|��Wntk
r YnXdS)N)r=r/)rrrrrB�szFeedParser._call_parsecCsR|j��|��|��}|jr$t�|��dkrN|��sNt�	�}|j
�||�|S)z<Parse all remaining data and return the root message object.�	multipart)r:rrB�_pop_messager;r#�get_content_maintypeZis_multipartrZ!MultipartInvariantViolationDefectr5�
handle_defect)r�root�defectrrrr�s

zFeedParser.closecCsn|jr|��}n|j|jd�}|jr<|j��dkr<|�d�|jrR|jd�|�|j�|�||_||_	dS)N)r5zmultipart/digestzmessage/rfc822r&)
r7r8r5r>�get_content_typeZset_default_typer;Zattachrr?)r�msgrrr�_new_message�s

zFeedParser._new_messagecCs(|j��}|jr|jd|_nd|_|S)Nr&)r;rr>)r�retvalrrrrE�s

zFeedParser._pop_messageccsD|��g}xb|jD]X}|tkr(tVqt�|�sbt�|�s`t��}|j�	|j
|�|j�|�P|�|�qW|�
|�|jr�g}x2|j��}|tkr�tVq�|dkr�P|�|�q�W|j
�t�|��dS|j
��dk�r�x�|j�tj�x$|��D]}|tk�rtVq�Pq�W|��}|j��x&|j��}|tk�rFtV�q(P�q(Wx&|j��}|tk�rntV�qPP�qPW|dk�r�P|j�|�q�WdS|j
��dk�r�x(|��D]}|tk�r�tV�q�P�q�W|��dS|j
��dk�r�|j
��}|dk�rbt��}|j�	|j
|�g}x.|jD]$}|tk�r<tV�q$|�|��q$W|j
�t�|��dSt|j
�dd����dk�r�t��}|j�	|j
|�d|}t� d	t�!|�d
�}	d}
g}d}d}
�x|j��}|tk�r�tV�q�|dk�r�P|	�|�}|�r�|�"d
��r d}
|�"d�}P|
�r�|�rn|d}t#�$|�}|�r`|dt%|�"d���|d<t�|�|j
_&d}
|j�|��q�xB|j��}|tk�r�tV�q�|	�|�}|�s�|j�|�P�q�W|j�|	j�x(|��D]}|tk�r�tV�q�P�q�W|j'��dk�rf|j'j(}|dk�r*d|j'_(n:|dk	�r�t#�$|�}|�r�t%|�"d��}|d|�|j'_(nD|j'j)}t*|t��r�t#�$|�}|�r�|dt%|�"d���}||j'_)|j��|��|j
|_'n|
�s�t+�|�|��q�W|
�rLt�,�}|j�	|j
|�|j
�t�|��g}x$|jD]}|tk�rtV�q�qWt�|�|j
_(dS|
�snt�-�}|j�	|j
|�dS|�r|dg}ng}x.|jD]$}|tk�r�tV�q�|�|��q�W|�r�|d}t.�|�}|�r�|t%|�"d��d�|d<t�|�|j
_(dSg}x.|jD]$}|tk�rtV�q|�|��qW|j
�t�|��dS)Nrzmessage/delivery-status�messagerDzcontent-transfer-encoding�8bit)Z7bitrOZbinaryz--z(?P<sep>z4)(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$TF�end�linesepr&r)/rLr:r�headerRE�match�NLCRErZ MissingHeaderBodySeparatorDefectr5rGr>r$r�_parse_headersr@r"Zset_payload�EMPTYSTRING�joinrJrr<rErrFZget_boundaryZNoBoundaryInMultipartDefect�str�get�lowerZ-InvalidMultipartContentTransferEncodingDefect�re�compile�escape�group�	NLCRE_eol�search�len�preambler?�epilogueZ_payload�
isinstancer#ZStartBoundaryNotFoundDefectZCloseBoundaryNotFoundDefect�	NLCRE_bol)rZheadersr!rIr-rMrK�boundaryZ	separatorZ
boundaryreZcapturing_preamblerbrQZclose_boundary_seen�moZlastlineZeolmorcrPZpayload�	firstlineZbolmorrrr<�sh





































zFeedParser._parsegenc	Csnd}g}�xDt|�D�]6\}}|ddkrV|sJt�|�}|j�|j|�q|�|�q|rx|jj|j�|��dg}}|�	d�r�|dkr�t
�|�}|r�|dt|�
d���}|j�|�qn:|t|�dkr�|j�|�dSt�|�}|jj�|�q|�d�}|dk�r(t�d�}|jj�|�q|dk�s:td��|d|�}|g}qW|�rj|jj|j�|��dS)	Nrrz 	zFrom ��:zMissing header name.z3_parse_headers fed line with no : and no leading WS)�	enumeraterZ#FirstHeaderLineIsContinuationDefectr5rGr>rZset_rawZheader_source_parse�
startswithr_r`rar^Zset_unixfromr:r$ZMisplacedEnvelopeHeaderDefectZdefects�findZInvalidHeaderDefectr#)	rr-Z
lastheaderZ	lastvalue�linenor!rIrg�irrrrU�sH









zFeedParser._parse_headers)N)r1r2r3r4rrrArCrBrrLrEr<rUrrrrr�s

~cs eZdZdZ�fdd�Z�ZS)rz(Like FeedParser, but feed accepts bytes.cst��|�dd��dS)N�ascii�surrogateescape)�superrC�decode)rr))�	__class__rrrCszBytesFeedParser.feed)r1r2r3r4rC�
__classcell__rr)rtrrs)r4�__all__r[ZemailrZemail._policybaser�collectionsr�iorr\rTrer_ZNLCRE_crackrRrV�NL�objectrr
rrrrrr�<module>s(




[
Name
Size
Permissions
Options
__init__.cpython-37.opt-1.pyc
1.648 KB
-rw-r--r--
__init__.cpython-37.opt-2.pyc
1.054 KB
-rw-r--r--
__init__.cpython-37.pyc
1.648 KB
-rw-r--r--
_encoded_words.cpython-37.opt-1.pyc
5.474 KB
-rw-r--r--
_encoded_words.cpython-37.opt-2.pyc
3.632 KB
-rw-r--r--
_encoded_words.cpython-37.pyc
5.474 KB
-rw-r--r--
_header_value_parser.cpython-37.opt-1.pyc
75.119 KB
-rw-r--r--
_header_value_parser.cpython-37.opt-2.pyc
58.956 KB
-rw-r--r--
_header_value_parser.cpython-37.pyc
75.166 KB
-rw-r--r--
_parseaddr.cpython-37.opt-1.pyc
12.125 KB
-rw-r--r--
_parseaddr.cpython-37.opt-2.pyc
9.234 KB
-rw-r--r--
_parseaddr.cpython-37.pyc
12.125 KB
-rw-r--r--
_policybase.cpython-37.opt-1.pyc
14.499 KB
-rw-r--r--
_policybase.cpython-37.opt-2.pyc
5.859 KB
-rw-r--r--
_policybase.cpython-37.pyc
14.499 KB
-rw-r--r--
base64mime.cpython-37.opt-1.pyc
3.156 KB
-rw-r--r--
base64mime.cpython-37.opt-2.pyc
1.421 KB
-rw-r--r--
base64mime.cpython-37.pyc
3.156 KB
-rw-r--r--
charset.cpython-37.opt-1.pyc
11.22 KB
-rw-r--r--
charset.cpython-37.opt-2.pyc
5.033 KB
-rw-r--r--
charset.cpython-37.pyc
11.256 KB
-rw-r--r--
contentmanager.cpython-37.opt-1.pyc
7.121 KB
-rw-r--r--
contentmanager.cpython-37.opt-2.pyc
7.121 KB
-rw-r--r--
contentmanager.cpython-37.pyc
7.121 KB
-rw-r--r--
encoders.cpython-37.opt-1.pyc
1.622 KB
-rw-r--r--
encoders.cpython-37.opt-2.pyc
1.279 KB
-rw-r--r--
encoders.cpython-37.pyc
1.622 KB
-rw-r--r--
errors.cpython-37.opt-1.pyc
6.043 KB
-rw-r--r--
errors.cpython-37.opt-2.pyc
4.537 KB
-rw-r--r--
errors.cpython-37.pyc
6.043 KB
-rw-r--r--
feedparser.cpython-37.opt-1.pyc
10.229 KB
-rw-r--r--
feedparser.cpython-37.opt-2.pyc
8.603 KB
-rw-r--r--
feedparser.cpython-37.pyc
10.377 KB
-rw-r--r--
generator.cpython-37.opt-1.pyc
12.204 KB
-rw-r--r--
generator.cpython-37.opt-2.pyc
8.595 KB
-rw-r--r--
generator.cpython-37.pyc
12.204 KB
-rw-r--r--
header.cpython-37.opt-1.pyc
15.999 KB
-rw-r--r--
header.cpython-37.opt-2.pyc
10.507 KB
-rw-r--r--
header.cpython-37.pyc
15.999 KB
-rw-r--r--
headerregistry.cpython-37.opt-1.pyc
20.883 KB
-rw-r--r--
headerregistry.cpython-37.opt-2.pyc
15.247 KB
-rw-r--r--
headerregistry.cpython-37.pyc
20.936 KB
-rw-r--r--
iterators.cpython-37.opt-1.pyc
1.884 KB
-rw-r--r--
iterators.cpython-37.opt-2.pyc
1.276 KB
-rw-r--r--
iterators.cpython-37.pyc
1.884 KB
-rw-r--r--
message.cpython-37.opt-1.pyc
37.101 KB
-rw-r--r--
message.cpython-37.opt-2.pyc
20.897 KB
-rw-r--r--
message.cpython-37.pyc
37.101 KB
-rw-r--r--
parser.cpython-37.opt-1.pyc
5.609 KB
-rw-r--r--
parser.cpython-37.opt-2.pyc
2.66 KB
-rw-r--r--
parser.cpython-37.pyc
5.609 KB
-rw-r--r--
policy.cpython-37.opt-1.pyc
9.426 KB
-rw-r--r--
policy.cpython-37.opt-2.pyc
3.354 KB
-rw-r--r--
policy.cpython-37.pyc
9.426 KB
-rw-r--r--
quoprimime.cpython-37.opt-1.pyc
7.481 KB
-rw-r--r--
quoprimime.cpython-37.opt-2.pyc
4.086 KB
-rw-r--r--
quoprimime.cpython-37.pyc
7.481 KB
-rw-r--r--
utils.cpython-37.opt-1.pyc
9.242 KB
-rw-r--r--
utils.cpython-37.opt-2.pyc
5.991 KB
-rw-r--r--
utils.cpython-37.pyc
9.242 KB
-rw-r--r--