mitsuhiko/werkzeug — pull request #274 by S11001001 (2013-03-24 18:59:04+00:00)
Title: Refactoring of multipart/form-data parser

This decomposes `MultiPartParser` into three processes:

1. `parse_lines` to yield a stream of a simple grammar of parse results, such as "chunk of a file".

2. `parse_parts` to organize these into form entries and file entries, also yielding a stream of these.

3. `parse` which minimally splits these and delivers them to the existing forms, files elements of `Request`.

The idea is to give users much more control over the process of parsing a `multipart/form-data` request without requiring reimplementation of the byte-level details of such parsing.

A test is also included.