]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
* when given, port should be converted to int
authorSkip Montanaro <skip@pobox.com>
Thu, 5 Dec 2002 02:43:14 +0000 (02:43 +0000)
committerSkip Montanaro <skip@pobox.com>
Thu, 5 Dec 2002 02:43:14 +0000 (02:43 +0000)
* when connecting, if the port is non-standard, display it as well

Tools/scripts/ftpmirror.py

index 0886af62a81fa38b531f5e9f54daed6a05f314d8..2e3b215835c6cad1b6feb0d6c437975a97df3cb5 100755 (executable)
@@ -55,6 +55,7 @@ def main():
     port = 0
     if ':' in host:
         host, port = host.split(':', 1)
+        port = int(port)
     try:
         auth = netrc.netrc().authenticators(host)
         if auth is not None:
@@ -81,7 +82,8 @@ def main():
             if args[3:]: usage('too many arguments')
     #
     f = ftplib.FTP()
-    if verbose: print 'Connecting to %s...' % `host`
+    if verbose: print "Connecting to '%s%s'..." % (host,
+                                                   (port and ":%d"%port or ""))
     f.connect(host,port)
     if not nologin:
         if verbose: