Skip to content

Commit 7359d70

Browse files
committed
consolidate AcceptCharsetXXXHeader classes into the single AcceptCharset class
1 parent 33ee697 commit 7359d70

File tree

5 files changed

+475
-1402
lines changed

5 files changed

+475
-1402
lines changed

CHANGES.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ Feature
2525
content-negotiation is needed versus using ``acceptable_offers`` directly.
2626
See https://github.com/Pylons/webob/pull/460
2727

28+
- Consolidation of ``AcceptCharset`` header handling into a single class.
29+
See backward incompatibilities below for more information.
30+
See https://github.com/Pylons/webob/pull/461
31+
32+
- ``webob.acceptparse.AcceptCharset``, methods ``best_match``, ``quality``, and
33+
``__contains__`` are now convenience methods for most use-cases where
34+
content-negotiation is needed versus using ``acceptable_offers`` directly.
35+
See backward incompatibilities below.
36+
See https://github.com/Pylons/webob/pull/461
37+
2838
Compatibility
2939
~~~~~~~~~~~~~
3040

@@ -51,6 +61,22 @@ Backwards Incompatibilities
5161
Their logic is consistent with ``acceptable_offers``.
5262
See https://github.com/Pylons/webob/pull/460
5363

64+
- Remove ``AcceptCharsetValidHeader``, ``AcceptCharsetNoHeader`` and
65+
``AcceptCharsetInvalidHeader``. These classes are consolidated into
66+
``AcceptCharset`` with a ``header_state`` attribute for users that need
67+
to know the state of the header.
68+
See https://github.com/Pylons/webob/pull/461
69+
70+
- Remove previously-deprecated ``webob.acceptparse.AcceptCharset.__iter__``.
71+
See https://github.com/Pylons/webob/pull/461
72+
73+
- ``webob.acceptparse.AcceptCharset`` methods, ``best_match``, ``quality``,
74+
and ``__contains__`` properly take into account the full header, including
75+
quality values of 0 prior to determining a match. Previously they would allow
76+
wildcards to match and override explicit ``q=0`` clauses. Their logic is now
77+
consistent with ``acceptable_offers``.
78+
See https://github.com/Pylons/webob/pull/461
79+
5480
Experimental Features
5581
~~~~~~~~~~~~~~~~~~~~~
5682

docs/api/webob.txt

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,14 @@ methods:
3131
.. autoclass:: Accept
3232
:members:
3333
parse, header_value, parsed, header_state, __init__, __add__,
34-
__bool__, __radd__, __repr__, __str__, __contains__,
34+
__bool__, __radd__, __repr__, __str__, __contains__, copy,
3535
accept_html, accepts_html, acceptable_offers, best_match, quality
3636

3737
.. autoclass:: AcceptCharset
38-
:members: parse
39-
40-
.. autoclass:: AcceptCharsetValidHeader
41-
:members: parse, header_value, parsed, __init__, __add__, __bool__,
42-
__contains__, __iter__, __radd__, __repr__, __str__,
43-
acceptable_offers, best_match, quality
44-
45-
.. autoclass:: AcceptCharsetNoHeader
46-
:members: parse, header_value, parsed, __init__, __add__, __bool__,
47-
__contains__, __iter__, __radd__, __repr__, __str__,
48-
acceptable_offers, best_match, quality
49-
50-
.. autoclass:: AcceptCharsetInvalidHeader
51-
:members: parse, header_value, parsed, __init__, __add__, __bool__,
52-
__contains__, __iter__, __radd__, __repr__, __str__,
53-
acceptable_offers, best_match, quality
38+
:members:
39+
parse, header_value, parsed, header_state, __init__, __add__,
40+
__bool__, __radd__, __repr__, __str__, __contains__, copy,
41+
acceptable_offers, best_match, quality
5442

5543
.. autoclass:: AcceptEncoding
5644
:members: parse

0 commit comments

Comments
 (0)