]> granicus.if.org Git - python/commitdiff
Whitespace normalization.
authorTim Peters <tim.peters@gmail.com>
Sun, 21 Jan 2001 04:49:16 +0000 (04:49 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 21 Jan 2001 04:49:16 +0000 (04:49 +0000)
Lib/chunk.py
Lib/robotparser.py
Lib/test/test___all__.py

index a38691fc1e298e5185bdb9aa8f23baabd11618a7..96460c047110c562fe20d45e5e30f67d8f27436e 100644 (file)
@@ -49,7 +49,7 @@ default is 1, i.e. aligned.
 """
 
 __all__ = ["Chunk"]
-           
+
 class Chunk:
     def __init__(self, file, align = 1, bigendian = 1, inclheader = 0):
         import struct
index 782d623b275b42c0854489cf4bed96ec2c21691e..f70827d940db35c011dbb934ecf51446c294b87a 100644 (file)
@@ -59,25 +59,25 @@ class RobotFileParser:
         elif status>=400:
             self.allow_all = 1
         else:
-           # status < 400
+            # status < 400
             self.parse(connection.getfile().readlines())
 
     def parse(self, lines):
         """parse the input lines from a robot.txt file.
-          We allow that a user-agent: line is not preceded by
-          one or more blank lines."""
+           We allow that a user-agent: line is not preceded by
+           one or more blank lines."""
         state = 0
         linenumber = 0
         entry = Entry()
-        
+
         for line in lines:
             line = string.strip(line)
             linenumber = linenumber + 1
             if not line:
                 if state==1:
                     _debug("line %d: warning: you should insert"
-                          " allow: or disallow: directives below any"
-                          " user-agent: line" % linenumber)
+                           " allow: or disallow: directives below any"
+                           " user-agent: line" % linenumber)
                     entry = Entry()
                     state = 0
                 elif state==2:
@@ -98,7 +98,7 @@ class RobotFileParser:
                 if line[0] == "user-agent":
                     if state==2:
                         _debug("line %d: warning: you should insert a blank"
-                              " line before any user-agent"
+                               " line before any user-agent"
                                " directive" % linenumber)
                         self.entries.append(entry)
                         entry = Entry()
@@ -107,14 +107,14 @@ class RobotFileParser:
                 elif line[0] == "disallow":
                     if state==0:
                         _debug("line %d: error: you must insert a user-agent:"
-                              " directive before this line" % linenumber)
+                               " directive before this line" % linenumber)
                     else:
                         entry.rulelines.append(RuleLine(line[1], 0))
                         state = 2
                 elif line[0] == "allow":
                     if state==0:
                         _debug("line %d: error: you must insert a user-agent:"
-                              " directive before this line" % linenumber)
+                               " directive before this line" % linenumber)
                     else:
                         entry.rulelines.append(RuleLine(line[1], 1))
                 else:
@@ -212,7 +212,7 @@ def _test():
     print rp.can_fetch('*', 'http://www.musi-cal.com/')
     print rp.can_fetch('Musi-Cal-Robot/1.0',
                        'http://www.musi-cal.com/cgi-bin/event-search'
-                      '?city=San+Francisco')
+                       '?city=San+Francisco')
 
 if __name__ == '__main__':
     _test()
index f811732a697f458d05db494d24320a6dfbb84155..4947a043dccf5514b9b88baef4cdc46fd87955c4 100644 (file)
@@ -1,4 +1,3 @@
-
 from test_support import verify, verbose, TestFailed
 import sys
 
@@ -8,7 +7,7 @@ def check_all(_modname):
            "%s has no __all__ attribute" % _modname)
     exec "del %s" % _modname
     exec "from %s import *" % _modname
-    
+
     _keys = locals().keys()
     _keys.remove("_modname")
     _keys.sort()