Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/future/backports/urllib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/future/backports/urllib/robotparser.pyc
�
,�]c@`s�ddlmZmZmZddlmZddlmZddlm	Z
mZe
e_	ee_dgZ
defd��YZdefd	��YZd
efd��YZdS(
i(tabsolute_importtdivisiontunicode_literals(tstr(turllib(tparsetrequestuRobotFileParsertRobotFileParsercB`sbeZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�ZRS(us This class provides a set of methods to read, parse and answer
    questions about a single robots.txt file.

    ucC`s>g|_d|_t|_t|_|j|�d|_dS(Ni(tentriestNonet
default_entrytFalsetdisallow_allt	allow_alltset_urltlast_checked(tselfturl((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyt__init__s				
cC`s|jS(u�Returns the time the robots.txt file was last fetched.

        This is useful for long-running web spiders that need to
        check for new robots.txt files periodically.

        (R(R((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pytmtime&scC`sddl}|j�|_dS(uYSets the time the robots.txt file was last fetched to the
        current time.

        iN(ttimeR(RR((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pytmodified/scC`s2||_tjj|�dd!\|_|_dS(u,Sets the URL referring to a robots.txt file.iiN(RRRturlparsethosttpath(RR((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR7s	cC`s�ytjj|j�}WnOtjjk
rj}|jdkrLt|_q�|jdkr�t|_	q�n)X|j
�}|j|jd�j
��dS(u4Reads the robots.txt URL and feeds it to the parser.i�i�i�uutf-8N(i�i�(RRturlopenRterrort	HTTPErrortcodetTrueRR
treadRtdecodet
splitlines(Rtfterrtraw((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR<scC`sAd|jkr-|jdkr=||_q=n|jj|�dS(Nu*(t
useragentsR
R	Rtappend(Rtentry((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyt
_add_entryIscC`sd}t�}x�|D]�}|sn|dkr@t�}d}qn|dkrn|j|�t�}d}qnn|jd�}|dkr�|| }n|j�}|s�qn|jdd�}t|�dkr|dj�j�|d<tjj	|dj��|d<|ddkr^|dkrA|j|�t�}n|j
j|d�d}q�|ddkr�|dkr�|jjt
|dt��d}q�q�|ddkr�|dkr�|jjt
|dt��d}q�q�qqW|dkr|j|�nd	S(
u�Parse the input lines from a robots.txt file.

        We allow that a user-agent: line is not preceded by
        one or more blank lines.
        iiiu#u:u
user-agentudisallowuallowN(tEntryR'tfindtstriptsplittlentlowerRRtunquoteR$R%t	rulelinestRuleLineRR(RtlineststateR&tlineti((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyRRsJ
	
		
	
 
	cC`s�|jr
tS|jrtStjjtjj|��}tjjdd|j	|j
|j|jf�}tjj
|�}|s�d}nx-|jD]"}|j|�r�|j|�Sq�W|jr�|jj|�StS(u=using the parsed robots.txt decide if useragent can fetch urluu/(RRR
RRRRR.t
urlunparseRtparamstquerytfragmenttquoteRt
applies_tot	allowanceR
(Rt	useragentRt
parsed_urlR&((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyt	can_fetch�s 				cC`s-djg|jD]}t|�d^q�S(Nuu
(tjoinRR(RR&((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyt__str__�s(t__name__t
__module__t__doc__RRRRRR'RR>R@(((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyRs					
			3	R0cB`s)eZdZd�Zd�Zd�ZRS(uoA rule line is a single "Allow:" (allowance==True) or "Disallow:"
       (allowance==False) followed by a path.cC`s>|dkr|rt}ntjj|�|_||_dS(Nu(RRRR9RR;(RRR;((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR�s	cC`s|jdkp|j|j�S(Nu*(Rt
startswith(Rtfilename((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR:�scC`s|jrdpdd|jS(NuAllowuDisallowu: (R;R(R((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR@�s(RARBRCRR:R@(((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR0�s		R(cB`s2eZdZd�Zd�Zd�Zd�ZRS(u?An entry has one or more user-agents and zero or more rulelinescC`sg|_g|_dS(N(R$R/(R((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR�s	cC`sjg}x'|jD]}|jd|dg�qWx*|jD]}|jt|�dg�q:Wdj|�S(NuUser-agent: u
u(R$textendR/RR?(RtrettagentR3((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR@�scC`s]|jd�dj�}x=|jD]2}|dkr9tS|j�}||kr#tSq#WtS(u2check if this entry applies to the specified agentu/iu*(R+R-R$RR(RR<RH((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR:�scC`s.x'|jD]}|j|�r
|jSq
WtS(uZPreconditions:
        - our agent applies to this entry
        - filename is URL decoded(R/R:R;R(RRER3((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR;�s(RARBRCRR@R:R;(((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyR(�s
			
N(t
__future__RRRtfuture.builtinsRtfuture.backportsRtfuture.backports.urllibRt_parseRt_requestt__all__tobjectRR0R((((sG/usr/lib/python2.7/site-packages/future/backports/urllib/robotparser.pyt<module>s			�

Spamworldpro Mini