Werkzeug 0.6 Refactoring
For Werkzeug 0.6 a last big refactoring is planned to get rid of all deprecations and to deprecate other things. Also the biggest modules should be split up into smallers.
Status: the majority is implemented, at least all that goes into 0.6. Cookie rewriting is targeted for 0.7.
New Modules
werkzeug.formparser
This module should get all the multipart and other parsing functions. Additionally the functions there should not depend on the higher-level datastructures Werkzeug provides.
- parse_multipart from werkzeug.http (depends on werkzeug.utils.FileStorage see Stuff to Move)
- parse_multipart_headers from werkzeug.http (depends on werkzeug.datastructures.Headers, werkzeug.http.parse_options_header)
- parse_form_data from werkzeug.utils
- default_factory from werkzeug.http (referenced from werkzeug.wrappers)
Q: Can we get rid of the datastructure/http dependencies for the header parsing?
werkzeug.cookies
Support for cookies. Should get a new cookie parser and the cookie functions.
- dump_cookie
- parse_cookie
Q: Why a new cookie parser?
A: We depend on the stdlib Cookie implementation and a hack on top of it. Also it still has many problems with corner cases in the cookies.
werkzeug.streams
A new module where all the stream tools go.
- LimitedStream
- make_line_iter
werkzeug.urls
- url_quote
- url_encode
- url_quote_plus
- url_fix
- url_unquote_plus
- url_decode
- url_unquote
- get_current_url (really?)
Stuff to Move
- werkzeug.utils.FileStorage -> werkzeug.datastructure
New Deprecations
- werkzeug.wrappers.BaseResponse.fix_headers — DONE
- werkzeug.wrappers.BaseResponse.header_list — DONE
- werkzeug.utils.LimitedStream.silent (the stream should always be silent, if one wants a nonsilent stream the on_exhausted method can be overridden)
What happens with _internal?
Should mostly go away.
- HTTP_STATUS_CODES -> werkzeug.consts?
- _parse_signature -> werkzeug.functools or something together with that bind_arguments thing
- all the date related stuff into werkzeug.dates where also a function for tz handling should go (naive, aware offset handling)
- morsel and cookie bullshit goes away
- property baseclasses could probably stay there, same for the easteregg
- logging into a new werkzeug.log module?