diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-02-12 22:18:30 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-02-12 22:18:30 +0100 |
commit | b902f957dd5df7391a8f1029623ba4d8c805dee1 (patch) | |
tree | c4a59071230bc8132901764e8c5ed245fb84128a | |
parent | 16433ccb0ce3bfaf54294893ef32adec6359c2f6 (diff) | |
download | mitmproxy-b902f957dd5df7391a8f1029623ba4d8c805dee1.tar.gz mitmproxy-b902f957dd5df7391a8f1029623ba4d8c805dee1.tar.bz2 mitmproxy-b902f957dd5df7391a8f1029623ba4d8c805dee1.zip |
more verbose sftp output
-rw-r--r-- | rtool.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -366,22 +366,23 @@ def upload_snapshot(host, port, user, private_key, private_key_password, sdist, old_version = f.replace(get_version(project), "*") for f in sftp.listdir(): if fnmatch.fnmatch(f, old_version): + print("Removing {}...".format(f)) sftp.remove(f) - print("Uploading {} as {}...".format(f, remote_filename)) + with click.progressbar(length=os.stat(local_path).st_size) as bar: + print("Uploading {} as {}...".format(f, remote_filename)) sftp.put( local_path, "." + remote_filename, callback=lambda done, total: bar.update(done - bar.pos) ) # We hide the file during upload. - if sftp.exists(remote_filename): - sftp.remove(remote_filename) sftp.rename("." + remote_filename, remote_filename) # add symlink if sftp.lexists(symlink_path): + print("Removing {}...".format(symlink_path)) sftp.remove(symlink_path) sftp.symlink("v{}/{}".format(get_version(project), remote_filename), symlink_path) |