Critics have remarked that those four worthies were truly peerless throughout the ages; yet the present falls short of the pastβ€”the ancients favored unadorned simplicity, whereas the moderns prefer refined elegance. Styles of substance and ornament rise and fall in succession, shifting with the changing mores of the times; such evolution is simply the natural order of things. The ideal lies in honoring antiquity without clashing with the present, and embracing modernity without succumbing to its flawsβ€”embodying that perfect balance of substance and refinement that defines the true gentleman. There is surely no need to abandon a carved palace in favor of a cave dwelling, or to trade a jade carriage for a primitive cart with solid wooden wheels.🌌 SpectraShell

🌌 SpectraShell

Current path: lib64/python2.7/



⬆️ Go up: /lib64

πŸ“„ Viewing: robotparser.pyo

οΏ½
zfc@s}dZddlZddlZdgZdddοΏ½οΏ½YZdddοΏ½οΏ½YZdd
dοΏ½οΏ½YZd	ejfd
οΏ½οΏ½YZdS(s& 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

iοΏ½οΏ½οΏ½οΏ½NtRobotFileParsercBsbeZdZddοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½Z	d	οΏ½Z
d
οΏ½ZRS(ss This class provides a set of methods to read, parse and answer
    questions about a single robots.txt file.

    tcCs>g|_d|_t|_t|_|j|οΏ½d|_dS(Ni(tentriestNonet
default_entrytFalsetdisallow_allt	allow_alltset_urltlast_checked(tselfturl((s#/usr/lib64/python2.7/robotparser.pyt__init__s				
cCs|jS(sοΏ½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
((s#/usr/lib64/python2.7/robotparser.pytmtime!scCsddl}|jοΏ½|_dS(sYSets the time the robots.txt file was last fetched to the
        current time.

        iοΏ½οΏ½οΏ½οΏ½N(ttimeR	(R
R((s#/usr/lib64/python2.7/robotparser.pytmodified*scCs/||_tj|οΏ½dd!\|_|_dS(s,Sets the URL referring to a robots.txt file.iiN(Rturlparsethosttpath(R
R((s#/usr/lib64/python2.7/robotparser.pyR2s	cCsοΏ½tοΏ½}|j|jοΏ½}g|D]}|jοΏ½^q"}|jοΏ½|j|_|jdkrkt|_nO|jdkrοΏ½|jdkrοΏ½t|_n%|jdkrοΏ½|rοΏ½|j	|οΏ½ndS(s4Reads the robots.txt URL and feeds it to the parser.iοΏ½iοΏ½iοΏ½iοΏ½iοΏ½N(iοΏ½iοΏ½(
t	URLopenertopenRtstriptcloseterrcodetTrueRRtparse(R
topenertftlinetlines((s#/usr/lib64/python2.7/robotparser.pytread7s	
cCsAd|jkr-|jdkr=||_q=n|jj|οΏ½dS(Nt*(t
useragentsRRRtappend(R
tentry((s#/usr/lib64/python2.7/robotparser.pyt
_add_entryEscCs&d}d}tοΏ½}|jοΏ½xοΏ½|D]οΏ½}|d7}|sοΏ½|dkrZtοΏ½}d}qοΏ½|dkrοΏ½|j|οΏ½tοΏ½}d}qοΏ½n|jdοΏ½}|dkrοΏ½|| }n|jοΏ½}|sοΏ½q&n|jddοΏ½}t|οΏ½dkr&|djοΏ½jοΏ½|d<tj	|djοΏ½οΏ½|d<|ddkru|dkrX|j|οΏ½tοΏ½}n|j
j|dοΏ½d}q|ddkrοΏ½|dkrοΏ½|jjt
|dtοΏ½οΏ½d}qοΏ½q|ddkr|dkrοΏ½|jjt
|dtοΏ½οΏ½d}qοΏ½qq&q&W|dkr"|j|οΏ½nd	S(
sοΏ½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.iiit#t:s
user-agenttdisallowtallowN(tEntryRR#tfindRtsplittlentlowerturllibtunquoteR R!t	rulelinestRuleLineRR(R
Rtstatet
linenumberR"Rti((s#/usr/lib64/python2.7/robotparser.pyRNsP	


		
	

	cCsοΏ½|jr
tS|jrtS|js'tStjtj|οΏ½οΏ½}tjdd|j	|j
|j|jfοΏ½}tj
|οΏ½}|sοΏ½d}nx-|jD]"}|j|οΏ½rοΏ½|j|οΏ½SqοΏ½W|jrοΏ½|jj|οΏ½StS(s=using the parsed robots.txt decide if useragent can fetch urlRt/(RRRRR	RR-R.t
urlunparseRtparamstquerytfragmenttquoteRt
applies_tot	allowanceR(R
t	useragentRt
parsed_urlR"((s#/usr/lib64/python2.7/robotparser.pyt	can_fetchοΏ½s$					cCsE|j}|jdk	r+||jg}ndjtt|οΏ½οΏ½dS(Ns
(RRRtjointmaptstr(R
R((s#/usr/lib64/python2.7/robotparser.pyt__str__οΏ½s	(t__name__t
__module__t__doc__RR
RRRR#RR>RB(((s#/usr/lib64/python2.7/robotparser.pyRs								4	 R0cBs)eZdZdοΏ½ZdοΏ½ZdοΏ½ZRS(soA rule line is a single "Allow:" (allowance==True) or "Disallow:"
       (allowance==False) followed by a path.cCsS|dkr|rt}ntjtj|οΏ½οΏ½}tj|οΏ½|_||_dS(NR(RRR5R-R9RR;(R
RR;((s#/usr/lib64/python2.7/robotparser.pyRοΏ½s
	cCs|jdkp|j|jοΏ½S(NR(Rt
startswith(R
tfilename((s#/usr/lib64/python2.7/robotparser.pyR:οΏ½scCs|jrdpdd|jS(NtAllowtDisallows: (R;R(R
((s#/usr/lib64/python2.7/robotparser.pyRBοΏ½s(RCRDRERR:RB(((s#/usr/lib64/python2.7/robotparser.pyR0οΏ½s		R(cBs2eZdZdοΏ½ZdοΏ½ZdοΏ½ZdοΏ½ZRS(s?An entry has one or more user-agents and zero or more rulelinescCsg|_g|_dS(N(R R/(R
((s#/usr/lib64/python2.7/robotparser.pyRοΏ½s	cCsjg}x'|jD]}|jd|dgοΏ½qWx*|jD]}|jt|οΏ½dgοΏ½q:Wdj|οΏ½S(NsUser-agent: s
R(R textendR/RAR?(R
trettagentR((s#/usr/lib64/python2.7/robotparser.pyRBοΏ½scCs]|jdοΏ½djοΏ½}x=|jD]2}|dkr9tS|jοΏ½}||kr#tSq#WtS(s2check if this entry applies to the specified agentR4iR(R*R,R RR(R
R<RL((s#/usr/lib64/python2.7/robotparser.pyR:οΏ½scCs.x'|jD]}|j|οΏ½r
|jSq
WtS(sZPreconditions:
        - our agent applies to this entry
        - filename is URL decoded(R/R:R;R(R
RGR((s#/usr/lib64/python2.7/robotparser.pyR;οΏ½s(RCRDRERRBR:R;(((s#/usr/lib64/python2.7/robotparser.pyR(οΏ½s
			
RcBs#eZdοΏ½ZdοΏ½ZdοΏ½ZRS(cGs tjj||οΏ½d|_dS(NiοΏ½(R-tFancyURLopenerRR(R
targs((s#/usr/lib64/python2.7/robotparser.pyRοΏ½scCsdS(N(NN(R(R
Rtrealm((s#/usr/lib64/python2.7/robotparser.pytprompt_user_passwdοΏ½scCs(||_tjj||||||οΏ½S(N(RR-RMthttp_error_default(R
RtfpRterrmsgtheaders((s#/usr/lib64/python2.7/robotparser.pyRQοΏ½s	(RCRDRRPRQ(((s#/usr/lib64/python2.7/robotparser.pyRοΏ½s		((((	RERR-t__all__RR0R(RMR(((s#/usr/lib64/python2.7/robotparser.pyt<module>s	οΏ½$


πŸ“