* when given, port should be converted to int

* when connecting, if the port is non-standard, display it as well
This commit is contained in:
Skip Montanaro 2002-12-05 02:43:14 +00:00
parent 7dfb02d09a
commit a5f8c42268
1 changed files with 3 additions and 1 deletions

View File

@ -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: