Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add middlewares documentation #632

Merged
merged 5 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/contributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ The Scrapy framework is very flexible. To maintain a good separation of concerns
- Raise a :class:`~kingfisher_scrapy.exceptions.AccessTokenError` exception in a request's callback, if the maximum number of attempts to retrieve an access token is reached
- Raise any other exception, to be caught by a `spider_error <https://docs.scrapy.org/en/latest/topics/signals.html#spider-error>`__ handler in an extension

- A downloader middleware's responsibility is to process requests, before they are sent to the internet, and responses, before they are processed by the spider. It should only:

- Yield a request, for example :class:`~kingfisher_scrapy.middlewares.ParaguayAuthMiddleware`
- Return a Deferred, for example :class:`~kingfisher_scrapy.middlewares.DelayedRequestMiddleware`
- Yield items, for example :class:`~kingfisher_scrapy.middlewares.AddPackageMiddleware`

- An item pipeline's responsibility is to clean, validate, filter, modify or substitute items. It should only:

- Return an item
Expand Down Expand Up @@ -195,3 +201,4 @@ API reference
extensions.rst
util.rst
exceptions.rst
middlewares.rst
6 changes: 6 additions & 0 deletions docs/contributing/middlewares.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Middlewares
===========

.. automodule:: kingfisher_scrapy.middlewares
:members:
:undoc-members: