boto/botocore — pull request #299 by jamesls (2014-06-02 23:13:00+00:00)
Title: Add register_first/register_last

Summary of changes:

* Remove EventHooks from hooks.py. Nothing is using it, and we'll have to keep updating this code as new interfaces as added, which is an unnecessary maintenance burden.
* Add register_first/register_last to the even emitter class. This ensures that `[register_first() + register() + register_last()]`.
* Update the S3 200 error response handler to use `register_first`. This is a refactoring step that has no functional change, but it provides a better guarantee that we will be called before the general retry logic.

Internally, each node in the trie stores a tuple of 3 lists (first, middle, last) instead of just a single list. When we get all the event handlers, we just concatenate the 3 lists.