Skip to content

Commit

Permalink
consolidate accept classes into the single AcceptCharset class
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerickel committed Mar 1, 2024
1 parent b0b14d7 commit c586619
Show file tree
Hide file tree
Showing 5 changed files with 471 additions and 1,411 deletions.
26 changes: 26 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Feature
content-negotiation is needed versus using ``acceptable_offers`` directly.
See https://github.com/Pylons/webob/pull/460

- Consolidation of ``AcceptCharset`` header handling into a single class.
See backward incompatibilities below for more information.
See https://github.com/Pylons/webob/pull/461

- ``webob.acceptparse.AcceptCharset``, methods ``best_match``, ``quality``, and
``__contains__`` are now convenience methods for most use-cases where
content-negotiation is needed versus using ``acceptable_offers`` directly.
See backward incompatibilities below.
See https://github.com/Pylons/webob/pull/461

Compatibility
~~~~~~~~~~~~~

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

- Remove ``AcceptCharsetValidHeader``, ``AcceptCharsetNoHeader`` and
``AcceptCharsetInvalidHeader``. These classes are consolidated into
``AcceptCharset`` with a ``header_state`` attribute for users that need
to know the state of the header.
See https://github.com/Pylons/webob/pull/461

- Remove previously-deprecated ``webob.acceptparse.AcceptCharset.__iter__``.
See https://github.com/Pylons/webob/pull/461

- ``webob.acceptparse.AcceptCharset`` methods, ``best_match``, ``quality``,
and ``__contains__`` properly take into account the full header, including
quality values of 0 prior to determining a match. Previously they would allow
wildcards to match and override explicit ``q=0`` clauses. Their logic is now
consistent with ``acceptable_offers``.
See https://github.com/Pylons/webob/pull/461

Experimental Features
~~~~~~~~~~~~~~~~~~~~~

Expand Down
22 changes: 5 additions & 17 deletions docs/api/webob.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,14 @@ methods:
.. autoclass:: Accept
:members:
parse, header_value, parsed, header_state, __init__, __add__,
__bool__, __radd__, __repr__, __str__, __contains__,
__bool__, __radd__, __repr__, __str__, __contains__, copy,
accept_html, accepts_html, acceptable_offers, best_match, quality

.. autoclass:: AcceptCharset
:members: parse

.. autoclass:: AcceptCharsetValidHeader
:members: parse, header_value, parsed, __init__, __add__, __bool__,
__contains__, __iter__, __radd__, __repr__, __str__,
acceptable_offers, best_match, quality

.. autoclass:: AcceptCharsetNoHeader
:members: parse, header_value, parsed, __init__, __add__, __bool__,
__contains__, __iter__, __radd__, __repr__, __str__,
acceptable_offers, best_match, quality

.. autoclass:: AcceptCharsetInvalidHeader
:members: parse, header_value, parsed, __init__, __add__, __bool__,
__contains__, __iter__, __radd__, __repr__, __str__,
acceptable_offers, best_match, quality
:members:
parse, header_value, parsed, header_state, __init__, __add__,
__bool__, __radd__, __repr__, __str__, __contains__, copy,
acceptable_offers, best_match, quality

.. autoclass:: AcceptEncoding
:members: parse
Expand Down
Loading

0 comments on commit c586619

Please sign in to comment.