summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChetan Sarva <chetan@pixelcop.net>2011-07-03 00:19:47 -0400
committerChetan Sarva <chetan@pixelcop.net>2011-07-03 00:19:47 -0400
commitd6bc0a1987148efb70871e1483fef524c54ddc95 (patch)
tree7973b25b3d9846ebf90496e24fda5e7466a600a5
parent3c155b42164a34c94a49971531d3a0bdc01930ee (diff)
downloadboto-d6bc0a1987148efb70871e1483fef524c54ddc95.tar.gz
cleanup debug statements
-rwxr-xr-xbin/s3multiput17
1 files changed, 7 insertions, 10 deletions
diff --git a/bin/s3multiput b/bin/s3multiput
index 4e38e526..7f57b239 100755
--- a/bin/s3multiput
+++ b/bin/s3multiput
@@ -105,13 +105,15 @@ def get_key_name(fullpath, prefix):
def _upload_part(bucketname, aws_key, aws_secret, multipart_id, part_num,
source_path, offset, bytes, debug, cb, num_cb, amount_of_retries=10):
- print "_upload_part(%s, %s, %s)" % (source_path, offset, bytes)
+ if debug == 1:
+ print "_upload_part(%s, %s, %s)" % (source_path, offset, bytes)
"""
Uploads a part with retries.
"""
def _upload(retries_left=amount_of_retries):
try:
- print 'Start uploading part #%d ...' % part_num
+ if debug == 1:
+ print 'Start uploading part #%d ...' % part_num
conn = S3Connection(aws_key, aws_secret)
conn.debug = debug
bucket = conn.get_bucket(bucketname)
@@ -125,18 +127,17 @@ def _upload_part(bucketname, aws_key, aws_secret, multipart_id, part_num,
if retries_left:
_upload(retries_left=retries_left - 1)
else:
- print '... Failed uploading part #%d' % part_num
+ print 'Failed uploading part #%d' % part_num
raise exc
else:
- print '... Uploaded part #%d' % part_num
+ if debug == 1:
+ print '... Uploaded part #%d' % part_num
_upload()
def upload(bucketname, aws_key, aws_secret, source_path, keyname,
reduced, debug, cb, num_cb,
acl='private', headers={}, guess_mimetype=True, parallel_processes=4):
-
- print "upload()"
"""
Parallel multipart upload.
"""
@@ -312,9 +313,5 @@ def main():
aws_secret_access_key, path, key_name,
reduced, debug, cb, num_cb)
-
-
-
if __name__ == "__main__":
main()
-