boto/boto — pull request #566 by tpodowd (2012-02-08 01:29:45+00:00)
Title: Various improvements around file pointer behavior and get_file/send_file...

....

- When setting contents, the file pointer now starts reading content
where you positioned it and returns the file pointer up to where
you finished reading. This is useful for multipart uploads of large
files where it is desirable to split them into different parts.

- Computing md5 for a file pointer now returns the file pointer to the
initial position instead of at the start of the file. It also takes
a size of bytes to read from the file pointer which enables it to
work well with multipart uploads.

- If the provider supports chunking, delay the md5 calculation to
when the file is being sent on the wire and send the Content-MD5
in the trailer. [THIS IS UNTESTED as I don't have a google storage
account and AWS doesn't support chunking for uploads.]

- Improve the callback so that it doesn't call too many times and
also doesn't call twice or more for the final chunk.

- Fix callback for get_file such that the Key size is available
when figuring out cb_count.

- get_file() now calculates the md5 as the stream is being read.
It is useful to have key.md5 available after reading contents in
case you want to verify what you read without re-calculating
the md5 of a paricularly large piece of data. key.md5 is set.

- after send_file() key.size will be accurate for the data that
you sent.

- Added unit tests for most of the work.