diff options
author | Guido van Rossum <guido@python.org> | 1993-11-08 15:05:21 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-11-08 15:05:21 (GMT) |
commit | e65cce5eec23812d77a54095209c923937cc3c92 (patch) | |
tree | ed0b87870ad9c6278e43acf63685b8823cce018c /Lib/ftplib.py | |
parent | db65a6ce556b1e311d03837fbf85ca52ef2c5d07 (diff) | |
download | cpython-e65cce5eec23812d77a54095209c923937cc3c92.zip cpython-e65cce5eec23812d77a54095209c923937cc3c92.tar.gz cpython-e65cce5eec23812d77a54095209c923937cc3c92.tar.bz2 |
* string.py: added rindex(), rfind(); changed index() to interpret
negative start indices starting from the right.
* ftplib.py: debug() -> set_debuglevel(); change demo to use __init__().
* os.py: added execl, execlp, and execvp.
* lambda.py: removed (now that we have built-in map, reduce, bagof, lambda)
* test_b{1,2}.py, testall.out: added tests for bagof, lambda, map, reduce
* commands.py: use os, not posix
* test_grammar.py: make it easy to disable non-portable int overflow tests
* dis.py: don't abuse range()
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r-- | Lib/ftplib.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 8342b09..dc66241 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -5,7 +5,7 @@ # Example: # # >>> from ftplib import FTP -# >>> ftp = FTP().init('ftp.cwi.nl') # connect to host, default port +# >>> ftp = FTP('ftp.cwi.nl') # connect to host, default port # >>> ftp.login() # default, i.e.: user anonymous, passwd user@hostname # >>> def handle_one_line(line): # callback for ftp.retrlines # ... print line @@ -109,8 +109,9 @@ class FTP: # 0: no debugging output (default) # 1: print commands and responses but not body text etc. # 2: also print raw lines read and sent before stripping CR/LF - def debug(self, level): + def set_debuglevel(self, level): self.debugging = level + debug = set_debuglevel # Internal: send one line to the server, appending CRLF def putline(self, line): @@ -405,8 +406,8 @@ def test(): debugging = debugging+1 del sys.argv[1] host = sys.argv[1] - ftp = FTP().init(host) - ftp.debug(debugging) + ftp = FTP(host) + ftp.set_debuglevel(debugging) ftp.login() def writeln(line): print line for file in sys.argv[2:]: |