boto/boto — pull request #453 by tpodowd (2011-12-29 03:25:37+00:00)
Title: Implement new Amazon Delete Multiple Object API

Hi all,

I had a little bit of free time today so I decided to implement the new Amazon API for deleting multiple objects in one request. I have tested it and it seems to work well. Should not have broken anything as it's quite isolated.

Example usage:

rs = bucket.list_versions()
probs = bucket.delete_multiple(rs)
for key in probs:
try:
print key.Code, "deleting", "%s:%s" % (key.name, key.version_id)
except:
print "Error deleting", key

Or a mixed list of strings and tuples...

keys = ["a", "b", ("c", "versionidhere"), ("c", "versionidhere"), "d"]
bucket.delete_multiple(keys)

Have fun!