try:
event_name = event_["eventName"]
// only process these two event types
if event_name not in [OBJECT_DELETE, OBJECT_PUT]:
continue
bucket = unquote(event_["s3"]["bucket"]["name"])
// In the grand tradition of IE6, S3 events turn spaces into "+"
key = unquote_plus(event_["s3"]["object"]["key"])
version_id = event_["s3"]["object"].get("versionId")
After Change
try:
event_name = event_["eventName"]
// Process all Create:* and Remove:* events
if not any(event_name.startswith(n) for n in EVENT_PREFIX.values()):
continue
bucket = unquote(event_["s3"]["bucket"]["name"])
// In the grand tradition of IE6, S3 events turn spaces into "+"