Skip to content

Commit

Permalink
docs: Fixed lots of sphinx warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
defnull committed Sep 5, 2024
1 parent d0d16fb commit 0213798
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 49 deletions.
11 changes: 4 additions & 7 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ API Reference
:synopsis: WSGI micro framework
.. moduleauthor:: Marcel Hellkamp <[email protected]>

This is a mostly auto-generated API. If you are new to bottle, you might find the
narrative :doc:`tutorial` more helpful.
Bottle prides itself on having source code that is easy to read and follow, so most questions about APIs or inner workings can be answered quickly by inspecting sources. Your IDE should give you the same information you'll find on this page, as most of it is auto-generates from docstrings and method signatures anyway. If you are new to bottle, you may find the :doc:`tutorial` more helpful as a starting point.



Expand All @@ -31,7 +30,6 @@ The module defines several functions, constants, and an exception.
.. autofunction:: run



Global decorators
=================

Expand All @@ -55,6 +53,7 @@ and decorators. All of those have a corresponding method on the :class:`Bottle`
.. autofunction:: hook



Request Context
===============

Expand All @@ -65,8 +64,8 @@ The global :data:`request` and :data:`response` instances are only valid from wi
.. autodata:: response


Utilities
=========
Helper Functions
================

.. autofunction:: abort

Expand All @@ -75,8 +74,6 @@ Utilities
.. autofunction:: static_file




Exceptions
==========

Expand Down
16 changes: 8 additions & 8 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ versions should not update to Bottle 0.13 and stick with 0.12 instead.

These changes might require special care when updating.

* Signed cookies now use a stronger HMAC algorithm by default. This will result in old cookies to appear invalid after the update. Pass an explicit ``digestmod=hashlib.md5`` to :meth:`Request.get_cookie` and :meth:`Response.set_cookie` to get the old behavior.
* Signed cookies now use a stronger HMAC algorithm by default. This will result in old cookies to appear invalid after the update. Pass an explicit ``digestmod=hashlib.md5`` to :meth:`BaseRequest.get_cookie` and :meth:`BaseResponse.set_cookie` to get the old behavior.
* Bottle now ships with its own multipart form data parser (borrowed from `multipart <https://pypi.org/project/multipart/>`_) and no longer relies on ``cgi.FieldStorage``, which was removed in Python 3.13. This may change the way broken (non-standard) form submissions are parsed. The new parser is more strict and correct than ohe old one.

.. rubric:: Other Improvements
Expand All @@ -72,7 +72,7 @@ These changes might require special care when updating.
* Added `aiohttp <http://aiohttp.readthedocs.io/en/stable/>`_ and `uvloop <https://github.com/MagicStack/uvloop>`_ server adapters.
* Added command-line arguments for config from json or ini files.
* :meth:`Bottle.mount` now recognizes instances of :class:`Bottle` and mounts them with significantly less overhead than other WSGI applications.
* The :attr:`Request.json` property now accepts ``application/json-rpc`` requests.
* The :attr:`BaseRequest.json` property now accepts ``application/json-rpc`` requests.
* :func:`static_file` gained support for ``ETag`` headers. It will generate ETags and recognizes ``If-None-Match`` headers.
* Jinja2 templates will produce better error messages than before.

Expand Down Expand Up @@ -108,7 +108,7 @@ Release 0.11

.. rubric:: API Changes

* :attr:`Response.status` is a read-write property that can be assigned either a numeric status code or a status string with a reason phrase (``200 OK``). The return value is now a string to better match existing APIs (WebOb, werkzeug). To be absolutely clear, you can use the read-only properties :attr:`BaseResponse.status_code` and :attr:`BaseResponse.status_line`.
* :attr:`BaseResponse.status` is a read-write property that can be assigned either a numeric status code or a status string with a reason phrase (``200 OK``). The return value is now a string to better match existing APIs (WebOb, werkzeug). To be absolutely clear, you can use the read-only properties :attr:`BaseResponse.status_code` and :attr:`BaseResponse.status_line`.

.. rubric:: API Deprecations

Expand Down Expand Up @@ -162,7 +162,7 @@ Release 0.9
* Support for SimpleTAL templates.
* Better runtime exception handling for mako templates in debug mode.
* Lots of documentation, fixes and small improvements.
* A new :data:`Request.urlparts` property.
* A new :data:`BaseRequest.urlparts` property.

.. rubric:: Performance improvements

Expand Down Expand Up @@ -198,8 +198,8 @@ These changes may break compatibility with previous versions.
* ``bottle.optimize()`` and the automatic route optimization is obsolete.
* Some functions and attributes were renamed:

* :attr:`Request._environ` is now :attr:`Request.environ`
* :attr:`Response.header` is now :attr:`Response.headers`
* :attr:`BaseRequest._environ` is now :attr:`BaseRequest.environ`
* :attr:`BaseResponse.header` is now :attr:`BaseResponse.headers`
* :func:`default_app` is obsolete. Use :func:`app` instead.

* The default :func:`redirect` code changed from 307 to 303.
Expand All @@ -210,8 +210,8 @@ These changes may break compatibility with previous versions.

This is an incomplete list of new features and improved functionality.

* The :class:`Request` object got new properties: :attr:`Request.body`, :attr:`Request.auth`, :attr:`Request.url`, :attr:`Request.header`, :attr:`Request.forms`, :attr:`Request.files`.
* The :meth:`Response.set_cookie` and :meth:`Request.get_cookie` methods are now able to encode and decode python objects. This is called a *secure cookie* because the encoded values are signed and protected from changes on client side. All pickle-able data structures are allowed.
* The :class:`Request` object got new properties: :attr:`BaseRequest.body`, :attr:`BaseRequest.auth`, :attr:`BaseRequest.url`, :attr:`BaseRequest.header`, :attr:`BaseRequest.forms`, :attr:`BaseRequest.files`.
* The :meth:`BaseResponse.set_cookie` and :meth:`BaseRequest.get_cookie` methods are now able to encode and decode python objects. This is called a *secure cookie* because the encoded values are signed and protected from changes on client side. All pickle-able data structures are allowed.
* The new :class:`Router` class drastically improves performance for setups with lots of dynamic routes and supports named routes (named route + dict = URL string).
* It is now possible (and recommended) to return :exc:`HTTPError` and :exc:`HTTPResponse` instances or other exception objects instead of raising them.
* The new function :func:`static_file` equals :func:`send_file` but returns a :exc:`HTTPResponse` or :exc:`HTTPError` instead of raising it. :func:`send_file` is deprecated.
Expand Down
Loading

0 comments on commit 0213798

Please sign in to comment.