From: Avery Pennarun Date: Fri, 23 Apr 2010 20:32:31 +0000 (-0400) Subject: cmd/ftp: if 'get' command returns an error, print it first. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=35097092c75673a83151bbddc710b2e51906210f;p=packages%2Fb%2Fbup.git cmd/ftp: if 'get' command returns an error, print it first. Previously we would print "Saving 'filename'" even if we were about to report that 'filename' doesn't exist or is the wrong file type. --- diff --git a/cmd/ftp-cmd.py b/cmd/ftp-cmd.py index 9daa479..f7b0492 100755 --- a/cmd/ftp-cmd.py +++ b/cmd/ftp-cmd.py @@ -116,8 +116,8 @@ for line in lines: rname = words[1] (dir,base) = os.path.split(rname) lname = len(words)>2 and words[2] or base - log('Saving %r\n' % lname) inf = pwd.resolve(rname).open() + log('Saving %r\n' % lname) write_to_file(inf, open(lname, 'wb')) elif cmd == 'mget': for parm in words[1:]: