Ñò §ÚêLc @ s} d Z d d k Z d d k Z d g Z d d d „ ƒ YZ d d d „ ƒ YZ d d d „ ƒ YZ d e i f d „ ƒ YZ d S( 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://info.webcrawler.com/mak/projects/robots/norobots-rfc.html iÿÿÿÿNt RobotFileParserc B sb e Z d Z d d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( ss This class provides a set of methods to read, parse and answer questions about a single robots.txt file. t c C s> g | _ d | _ t | _ t | _ | i | ƒ d | _ d S( Ni ( t entriest Nonet default_entryt Falset disallow_allt allow_allt set_urlt last_checked( t selft url( ( s# /usr/lib64/python2.6/robotparser.pyt __init__ s c C s | i S( 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.6/robotparser.pyt mtime s c C s d d k } | i ƒ | _ d S( sY Sets the time the robots.txt file was last fetched to the current time. iÿÿÿÿN( t timeR ( R R ( ( s# /usr/lib64/python2.6/robotparser.pyt modified) s c C s/ | | _ t i | ƒ d d !\ | _ | _ d S( s, Sets the URL referring to a robots.txt file.i i N( R t urlparset hostt path( R R ( ( s# /usr/lib64/python2.6/robotparser.pyR 1 s c C s¾ t ƒ } | i | i ƒ } g } | D] } | | i ƒ q&