[Python-checkins] python/dist/src/Tools/scripts ftpmirror.py,1.16,1.17

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
2002年12月04日 18:43:16 -0800


Update of /cvsroot/python/python/dist/src/Tools/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv22142
Modified Files:
	ftpmirror.py 
Log Message:
* when given, port should be converted to int
* when connecting, if the port is non-standard, display it as well
Index: ftpmirror.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/scripts/ftpmirror.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** ftpmirror.py	5 Dec 2002 02:37:23 -0000	1.16
--- ftpmirror.py	5 Dec 2002 02:43:14 -0000	1.17
***************
*** 56,59 ****
--- 56,60 ----
 if ':' in host:
 host, port = host.split(':', 1)
+ port = int(port)
 try:
 auth = netrc.netrc().authenticators(host)
***************
*** 82,86 ****
 #
 f = ftplib.FTP()
! if verbose: print 'Connecting to %s...' % `host`
 f.connect(host,port)
 if not nologin:
--- 83,88 ----
 #
 f = ftplib.FTP()
! if verbose: print "Connecting to '%s%s'..." % (host,
! (port and ":%d"%port or ""))
 f.connect(host,port)
 if not nologin:

AltStyle によって変換されたページ (->オリジナル) /