diff options
author | Joel Wright <joel.wright@sohonet.com> | 2015-01-04 21:14:02 +0000 |
---|---|---|
committer | Joel Wright <joel.wright@sohonet.com> | 2015-01-23 11:46:13 +0000 |
commit | bd42c2b00d0e4a18d15fd494bd9b9101742c4a37 (patch) | |
tree | 13aeb9c42ef70b6cd13a9bd3fd001cb66c81e1c5 /swiftclient/shell.py | |
parent | 7709fea51e71084163cf56c4d11a280ca4388357 (diff) | |
download | python-swiftclient-bd42c2b00d0e4a18d15fd494bd9b9101742c4a37.tar.gz |
This patch fixes downloading files to stdout.
This patch fixes downloading files to stdout and modifies
_SwiftReader to operate as an iterator that performs file
checks at the end of iteration as well as a context manager.
File verification checks have been removed from __exit__
and added to __iter__.
Change-Id: I3250bdeeef8484a9122c4b5b854756a7c8f8731e
Closes-Bug: 1395922
Closes-Bug: 1387376
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-x | swiftclient/shell.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py index c3f4628..a747625 100755 --- a/swiftclient/shell.py +++ b/swiftclient/shell.py @@ -16,9 +16,9 @@ from __future__ import print_function +import logging import signal import socket -import logging from optparse import OptionParser, OptionGroup, SUPPRESS_HELP from os import environ, walk, _exit as os_exit @@ -261,8 +261,9 @@ def st_download(parser, args, output_manager): for down in down_iter: if options.out_file == '-' and 'contents' in down: - for chunk in down['contents']: - output_manager.print_msg(chunk) + contents = down['contents'] + for chunk in contents: + output_manager.print_raw(chunk) else: if down['success']: if options.verbose: |