summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2001-10-18 20:58:25 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2001-10-18 20:58:25 (GMT)
commita5e616510e57a5269d53a9cea1d98ea095879c58 (patch)
treecef17beb11fee14b58f09952a979b592dec61fac
parenta4dc73e2469f9662a1f48e1a2990fc7c0a1377fc (diff)
downloadcpython-a5e616510e57a5269d53a9cea1d98ea095879c58.zip
cpython-a5e616510e57a5269d53a9cea1d98ea095879c58.tar.gz
cpython-a5e616510e57a5269d53a9cea1d98ea095879c58.tar.bz2
changed misleading argument name
-rw-r--r--Doc/lib/libnntplib.tex10
-rw-r--r--Lib/nntplib.py26
2 files changed, 18 insertions, 18 deletions
diff --git a/Doc/lib/libnntplib.tex b/Doc/lib/libnntplib.tex
index bf26b7d..e0f9989 100644
--- a/Doc/lib/libnntplib.tex
+++ b/Doc/lib/libnntplib.tex
@@ -197,14 +197,14 @@ and \var{list} is a list of the article's headers (an uninterpreted
list of lines, without trailing newlines).
\end{methoddesc}
-\begin{methoddesc}{body}{id,\optional{fileHandle}}
+\begin{methoddesc}{body}{id,\optional{file}}
Send a \samp{BODY} command, where \var{id} has the same meaning as for
-\method{stat()}. If the \var{fileHandle} parameter is supplied, then
-the body is stored in a file. If \var{fileHandle} is a string, then
+\method{stat()}. If the \var{file} parameter is supplied, then
+the body is stored in a file. If \var{file} is a string, then
the method will open a file object with that name, write to it then close it.
-If \var{fileHandle} is a file object, then it will start calling
+If \var{file} is a file object, then it will start calling
\method{write()} on it to store the lines of the body.
-Return as for \method{head()}. If \var{fileHandle} is supplied. Then
+Return as for \method{head()}. If \var{file} is supplied. Then
the returned \var{list} is an empty list.
\end{methoddesc}
diff --git a/Lib/nntplib.py b/Lib/nntplib.py
index d5bc902..fad6b08 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -211,15 +211,15 @@ class NNTP:
raise NNTPProtocolError(resp)
return resp
- def getlongresp(self,fileHandle=None):
+ def getlongresp(self, file=None):
"""Internal: get a response plus following text from the server.
Raise various errors if the response indicates an error."""
openedFile = None
try:
# If a string was passed then open a file with that name
- if isinstance(fileHandle, types.StringType):
- openedFile = fileHandle = open(fileHandle, "w")
+ if isinstance(file, types.StringType):
+ openedFile = file = open(file, "w")
resp = self.getresp()
if resp[:3] not in LONGRESP:
@@ -231,8 +231,8 @@ class NNTP:
break
if line[:2] == '..':
line = line[1:]
- if fileHandle:
- fileHandle.write(line + "\n")
+ if file:
+ file.write(line + "\n")
else:
list.append(line)
finally:
@@ -247,10 +247,10 @@ class NNTP:
self.putcmd(line)
return self.getresp()
- def longcmd(self, line, fileHandle=None):
+ def longcmd(self, line, file=None):
"""Internal: send a command and get the response plus following text."""
self.putcmd(line)
- return self.getlongresp(fileHandle)
+ return self.getlongresp(file)
def newgroups(self, date, time):
"""Process a NEWGROUPS command. Arguments:
@@ -355,9 +355,9 @@ class NNTP:
"""Process a LAST command. No arguments. Return as for STAT."""
return self.statcmd('LAST')
- def artcmd(self, line, fileHandle=None):
+ def artcmd(self, line, file=None):
"""Internal: process a HEAD, BODY or ARTICLE command."""
- resp, list = self.longcmd(line,fileHandle)
+ resp, list = self.longcmd(line, file)
resp, nr, id = self.statparse(resp)
return resp, nr, id, list
@@ -372,18 +372,18 @@ class NNTP:
return self.artcmd('HEAD ' + id)
- def body(self, id, fileHandle=None):
+ def body(self, id, file=None):
"""Process a BODY command. Argument:
- id: article number or message id
- - fileHandle: Filename string or file object to store the article in
+ - file: Filename string or file object to store the article in
Returns:
- resp: server response if successful
- nr: article number
- id: message id
- list: the lines of the article's body or an empty list
- if fileHandle was used"""
+ if file was used"""
- return self.artcmd('BODY ' + id, fileHandle)
+ return self.artcmd('BODY ' + id, file)
def article(self, id):
"""Process an ARTICLE command. Argument: