HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python3.5/urllib/__pycache__/robotparser.cpython-35.pyc


Fa4@sddZddlZddlZdgZGdddZGdddZGdddZdS)	a% robotparser.py

    Copyright (C) 2000  Bastian Kleineidam

    You can choose between two licenses when using this package:
    1) GNU GPLv2
    2) PSF license for Python 2.2

    The robots.txt Exclusion Protocol is implemented as specified in
    http://www.robotstxt.org/norobots-rfc.txt
NRobotFileParserc@seZdZdZdddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZdS)rzs This class provides a set of methods to read, parse and answer
    questions about a single robots.txt file.

    cCs>g|_d|_d|_d|_|j|d|_dS)NFr)entries
default_entrydisallow_all	allow_allset_urllast_checked)selfurlr(/usr/lib/python3.5/urllib/robotparser.py__init__s				
zRobotFileParser.__init__cCs|jS)zReturns 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
rrr
mtimeszRobotFileParser.mtimecCsddl}|j|_dS)zYSets the time the robots.txt file was last fetched to the
        current time.

        rN)timer	)r
rrrr
modified(szRobotFileParser.modifiedcCs5||_tjj|dd\|_|_dS)z,Sets the URL referring to a robots.txt file.N)rurllibparseurlparseZhostpath)r
rrrr
r0s	zRobotFileParser.set_urlcCsytjj|j}Wnmtjjk
r}zG|jdkrOd|_n'|jdkrv|jdkrvd|_WYdd}~Xn)X|j	}|j
|jdjdS)	z4Reads the robots.txt URL and feeds it to the parser.TiiNzutf-8)rr)
rZrequestZurlopenrerrorZ	HTTPErrorcoderrreadrdecode
splitlines)r
ferrrawrrr
r5szRobotFileParser.readcCs>d|jkr*|jdkr:||_n|jj|dS)N*)
useragentsrrappend)r
entryrrr

_add_entryBszRobotFileParser._add_entrycCsd}t}|jx|D]}|sr|dkrJt}d}n(|dkrr|j|t}d}|jd}|dkr|d|}|j}|sq |jdd}t|dkr |djj|d<tj	j
|dj|d<|ddkr_|dkrB|j|t}|jj|dd}q |ddkr|dkr|j
jt|dd	d}q |dd
kr |dkr |j
jt|ddd}q W|dkr|j|dS)zParse the input lines from a robots.txt file.

        We allow that a user-agent: line is not preceded by
        one or more blank lines.
        rr#N:z
user-agentZdisallowFZallowT)Entryrr&findstripsplitlenlowerrrunquoter#r$	rulelinesRuleLine)r
linesstater%lineirrr
rKsL
	

		
	 
			
zRobotFileParser.parsecCs|jr
dS|jrdS|js'dStjjtjj|}tjjdd|j|j	|j
|jf}tjj|}|sd}x-|j
D]"}|j|r|j|SqW|jr|jj|SdS)z=using the parsed robots.txt decide if useragent can fetch urlFTr/)rrr	rrrr0
urlunparserZparamsZqueryZfragmentquoter
applies_to	allowancer)r
	useragentrZ
parsed_urlr%rrr
	can_fetchs$				zRobotFileParser.can_fetchcCsdjdd|jDS)NrcSs g|]}t|dqS)
)str).0r%rrr

<listcomp>s	z+RobotFileParser.__str__.<locals>.<listcomp>)joinr)r
rrr
__str__szRobotFileParser.__str__N)
__name__
__module____qualname____doc__rrrrrr&rr=rCrrrr
rs	
	4c@s:eZdZdZddZddZddZdS)	r2zoA rule line is a single "Allow:" (allowance==True) or "Disallow:"
       (allowance==False) followed by a path.cCsY|dkr|rd}tjjtjj|}tjj||_||_dS)NrT)rrr8rr9rr;)r
rr;rrr
rs
zRuleLine.__init__cCs|jdkp|j|jS)Nr")r
startswith)r
filenamerrr
r:szRuleLine.applies_tocCs|jrdndd|jS)NZAllowZDisallowz: )r;r)r
rrr
rCszRuleLine.__str__N)rDrErFrGrr:rCrrrr
r2sr2c@sFeZdZdZddZddZddZdd	Zd
S)r*z?An entry has one or more user-agents and zero or more rulelinescCsg|_g|_dS)N)r#r1)r
rrr
rs	zEntry.__init__cCsjg}x'|jD]}|jd|dgqWx*|jD]}|jt|dgq:Wdj|S)NzUser-agent: r>r)r#extendr1r?rB)r
Zretagentr5rrr
rCsz
Entry.__str__cCs]|jddj}x=|jD]2}|dkr9dS|j}||kr#dSq#WdS)z2check if this entry applies to the specified agentr7rr"TF)r-r/r#)r
r<rKrrr
r:szEntry.applies_tocCs.x'|jD]}|j|r
|jSq
WdS)zZPreconditions:
        - our agent applies to this entry
        - filename is URL decodedT)r1r:r;)r
rIr5rrr
r;szEntry.allowanceN)rDrErFrGrrCr:r;rrrr
r*s

r*)rGZurllib.parserZurllib.request__all__rr2r*rrrr
<module>s