[Python-checkins] CVS: python/dist/src/Lib nntplib.py,1.27,1.28
Fredrik Lundh
effbot@users.sourceforge.net
Thu, 18 Oct 2001 13:58:27 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv15002/Lib
Modified Files:
nntplib.py
Log Message:
changed misleading argument name
Index: nntplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/nntplib.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** nntplib.py 2001/10/01 13:46:55 1.27
--- nntplib.py 2001/10/18 20:58:25 1.28
***************
*** 212,216 ****
return resp
! def getlongresp(self,fileHandle=None):
"""Internal: get a response plus following text from the server.
Raise various errors if the response indicates an error."""
--- 212,216 ----
return resp
! def getlongresp(self, file=None):
"""Internal: get a response plus following text from the server.
Raise various errors if the response indicates an error."""
***************
*** 219,224 ****
try:
# If a string was passed then open a file with that name
! if isinstance(fileHandle, types.StringType):
! openedFile = fileHandle = open(fileHandle, "w")
resp = self.getresp()
--- 219,224 ----
try:
# If a string was passed then open a file with that name
! if isinstance(file, types.StringType):
! openedFile = file = open(file, "w")
resp = self.getresp()
***************
*** 232,237 ****
if line[:2] == '..':
line = line[1:]
! if fileHandle:
! fileHandle.write(line + "\n")
else:
list.append(line)
--- 232,237 ----
if line[:2] == '..':
line = line[1:]
! if file:
! file.write(line + "\n")
else:
list.append(line)
***************
*** 248,255 ****
return self.getresp()
! def longcmd(self, line, fileHandle=None):
"""Internal: send a command and get the response plus following text."""
self.putcmd(line)
! return self.getlongresp(fileHandle)
def newgroups(self, date, time):
--- 248,255 ----
return self.getresp()
! def longcmd(self, line, file=None):
"""Internal: send a command and get the response plus following text."""
self.putcmd(line)
! return self.getlongresp(file)
def newgroups(self, date, time):
***************
*** 356,362 ****
return self.statcmd('LAST')
! def artcmd(self, line, fileHandle=None):
"""Internal: process a HEAD, BODY or ARTICLE command."""
! resp, list = self.longcmd(line,fileHandle)
resp, nr, id = self.statparse(resp)
return resp, nr, id, list
--- 356,362 ----
return self.statcmd('LAST')
! def artcmd(self, line, file=None):
"""Internal: process a HEAD, BODY or ARTICLE command."""
! resp, list = self.longcmd(line, file)
resp, nr, id = self.statparse(resp)
return resp, nr, id, list
***************
*** 373,380 ****
return self.artcmd('HEAD ' + id)
! def body(self, id, fileHandle=None):
"""Process a BODY command. Argument:
- id: article number or message id
! - fileHandle: Filename string or file object to store the article in
Returns:
- resp: server response if successful
--- 373,380 ----
return self.artcmd('HEAD ' + id)
! def body(self, id, file=None):
"""Process a BODY command. Argument:
- id: article number or message id
! - file: Filename string or file object to store the article in
Returns:
- resp: server response if successful
***************
*** 382,388 ****
- id: message id
- list: the lines of the article's body or an empty list
! if fileHandle was used"""
! return self.artcmd('BODY ' + id, fileHandle)
def article(self, id):
--- 382,388 ----
- id: message id
- list: the lines of the article's body or an empty list
! if file was used"""
! return self.artcmd('BODY ' + id, file)
def article(self, id):