Copied some of SEP-019

Paul Tremberth 2014-02-06 12:53:09 -08:00
parent 3aba3b3a25
commit 2259db46cb
1 changed files with 21 additions and 1 deletions

@ -36,7 +36,27 @@ which should encourage more writing more (and better) extensions
**_Pablo to write a new SEP document._**
### Per-spider settings (SEP-19)
https://github.com/scrapy/scrapy/blob/master/sep/sep-019.rst
This is a proposal to add support for overriding settings per-spiders in a consistent way.
In short, you will be able to overwrite settings (on a per-spider basis) by implementing a class method in your spider:
def MySpider(BaseSpider):
@classmethod
def custom_settings(cls):
return {
"DOWNLOAD_DELAY": 5.0,
"RETRY_ENABLED": False,
}
**What this solves**
* support true overridable per-spider setting, from both command-line usage and library mode
* support for accessing settings from spiders (currently not supported without hacky code)
* avoids mistakenly believing you can change settings after they have been populated (you can, but they won't have any effect)
More details and some implementation proposals can be found in https://github.com/scrapy/scrapy/blob/master/sep/sep-019.rst
### Better generator support
Mikhail: