[Python-checkins] CVS: python/dist/src/Lib chunk.py,1.7,1.8 robotparser.py,1.5,1.6
Tim Peters
tim_one@users.sourceforge.net
Sat, 20 Jan 2001 20:49:18 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv20659/python/dist/src/Lib
Modified Files:
chunk.py robotparser.py
Log Message:
Whitespace normalization.
Index: chunk.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/chunk.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** chunk.py 2001/01/20 19:54:20 1.7
--- chunk.py 2001/01/21 04:49:16 1.8
***************
*** 50,54 ****
__all__ = ["Chunk"]
!
class Chunk:
def __init__(self, file, align = 1, bigendian = 1, inclheader = 0):
--- 50,54 ----
__all__ = ["Chunk"]
!
class Chunk:
def __init__(self, file, align = 1, bigendian = 1, inclheader = 0):
Index: robotparser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/robotparser.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** robotparser.py 2001/01/20 19:54:20 1.5
--- robotparser.py 2001/01/21 04:49:16 1.6
***************
*** 60,74 ****
self.allow_all = 1
else:
! # 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."""
state = 0
linenumber = 0
entry = Entry()
!
for line in lines:
line = string.strip(line)
--- 60,74 ----
self.allow_all = 1
else:
! # 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."""
state = 0
linenumber = 0
entry = Entry()
!
for line in lines:
line = string.strip(line)
***************
*** 77,82 ****
if state==1:
_debug("line %d: warning: you should insert"
! " allow: or disallow: directives below any"
! " user-agent: line" % linenumber)
entry = Entry()
state = 0
--- 77,82 ----
if state==1:
_debug("line %d: warning: you should insert"
! " allow: or disallow: directives below any"
! " user-agent: line" % linenumber)
entry = Entry()
state = 0
***************
*** 99,103 ****
if state==2:
_debug("line %d: warning: you should insert a blank"
! " line before any user-agent"
" directive" % linenumber)
self.entries.append(entry)
--- 99,103 ----
if state==2:
_debug("line %d: warning: you should insert a blank"
! " line before any user-agent"
" directive" % linenumber)
self.entries.append(entry)
***************
*** 108,112 ****
if state==0:
_debug("line %d: error: you must insert a user-agent:"
! " directive before this line" % linenumber)
else:
entry.rulelines.append(RuleLine(line[1], 0))
--- 108,112 ----
if state==0:
_debug("line %d: error: you must insert a user-agent:"
! " directive before this line" % linenumber)
else:
entry.rulelines.append(RuleLine(line[1], 0))
***************
*** 115,119 ****
if state==0:
_debug("line %d: error: you must insert a user-agent:"
! " directive before this line" % linenumber)
else:
entry.rulelines.append(RuleLine(line[1], 1))
--- 115,119 ----
if state==0:
_debug("line %d: error: you must insert a user-agent:"
! " directive before this line" % linenumber)
else:
entry.rulelines.append(RuleLine(line[1], 1))
***************
*** 213,217 ****
print rp.can_fetch('Musi-Cal-Robot/1.0',
'http://www.musi-cal.com/cgi-bin/event-search'
! '?city=San+Francisco')
if __name__ == '__main__':
--- 213,217 ----
print rp.can_fetch('Musi-Cal-Robot/1.0',
'http://www.musi-cal.com/cgi-bin/event-search'
! '?city=San+Francisco')
if __name__ == '__main__':