Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
urllib.robotparser.RuleLine Class Reference

List of all members.

Public Member Functions

def __init__
def applies_to
def __str__

Public Attributes

 path
 allowance

Detailed Description

A rule line is a single "Allow:" (allowance==True) or "Disallow:"
   (allowance==False) followed by a path.

Definition at line 153 of file robotparser.py.


Constructor & Destructor Documentation

def urllib.robotparser.RuleLine.__init__ (   self,
  path,
  allowance 
)

Definition at line 156 of file robotparser.py.

00156 
00157     def __init__(self, path, allowance):
00158         if path == '' and not allowance:
00159             # an empty value means allow all
00160             allowance = True
00161         self.path = urllib.parse.quote(path)
00162         self.allowance = allowance

Here is the caller graph for this function:


Member Function Documentation

Definition at line 166 of file robotparser.py.

00166 
00167     def __str__(self):
00168         return (self.allowance and "Allow" or "Disallow") + ": " + self.path
00169 

def urllib.robotparser.RuleLine.applies_to (   self,
  filename 
)

Definition at line 163 of file robotparser.py.

00163 
00164     def applies_to(self, filename):
00165         return self.path == "*" or filename.startswith(self.path)


Member Data Documentation

Definition at line 161 of file robotparser.py.

Definition at line 160 of file robotparser.py.


The documentation for this class was generated from the following file: