diff options
author | Walter Dörwald <walter@livinglogic.de> | 2002-09-11 20:36:02 +0000 |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2002-09-11 20:36:02 +0000 |
commit | aaab30e00cc3e8d90c71b8657c284feeb4ac1413 (patch) | |
tree | d055e0bd374770014d9afdff1b961418b1828584 /Tools/scripts/ftpmirror.py | |
parent | 6a0477b099560a452e37fe77c3850bf232487c16 (diff) | |
download | cpython-git-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.tar.gz |
Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py)
This replaces string module functions with string methods
for the stuff in the Tools directory. Several uses of
string.letters etc. are still remaining.
Diffstat (limited to 'Tools/scripts/ftpmirror.py')
-rwxr-xr-x | Tools/scripts/ftpmirror.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Tools/scripts/ftpmirror.py b/Tools/scripts/ftpmirror.py index 38af9dc8b7..c3469d06b8 100755 --- a/Tools/scripts/ftpmirror.py +++ b/Tools/scripts/ftpmirror.py @@ -22,7 +22,6 @@ import os import sys import time import getopt -import string import ftplib import netrc from fnmatch import fnmatch @@ -127,7 +126,7 @@ def mirrorsubdir(f, localdir): if mac: # Mac listing has just filenames; # trailing / means subdirectory - filename = string.strip(line) + filename = line.strip() mode = '-' if filename[-1:] == '/': filename = filename[:-1] @@ -135,12 +134,12 @@ def mirrorsubdir(f, localdir): infostuff = '' else: # Parse, assuming a UNIX listing - words = string.split(line, None, 8) + words = line.split(None, 8) if len(words) < 6: if verbose > 1: print 'Skipping short line' continue - filename = string.lstrip(words[-1]) - i = string.find(filename, " -> ") + filename = words[-1].lstrip() + i = filename.find(" -> ") if i >= 0: # words[0] had better start with 'l'... if verbose > 1: @@ -360,7 +359,7 @@ class LoggingFile: def askabout(filetype, filename, pwd): prompt = 'Retrieve %s %s from %s ? [ny] ' % (filetype, filename, pwd) while 1: - reply = string.lower(string.strip(raw_input(prompt))) + reply = raw_input(prompt).strip().lower() if reply in ['y', 'ye', 'yes']: return 1 if reply in ['', 'n', 'no', 'nop', 'nope']: |