Scrapy, a fast high-level web crawling & scraping framework for Python.
improved SpiderMiddleware's docstrings
Pablo Hoffman037e6c212593
diff --git a/scrapy/trunk/scrapy/contrib/spidermiddleware/limit.py b/scrapy/trunk/scrapy/contrib/spidermiddleware/limit.pyindex 18fea0406..4d4d1bb8d 100644--- a/scrapy/trunk/scrapy/contrib/spidermiddleware/limit.py+++ b/scrapy/trunk/scrapy/contrib/spidermiddleware/limit.py@@ -1,12 +1,14 @@"""-Limits the scheduler request queue from the point of view of the spider.-That is, if the scheduler queue contains an equal or greater ammount of-requests than the specified limit, the further requests generated by the-spider will be ignored.+RequestLimitMiddleware: Limits the scheduler request queue from the point of+view of the spider. That is, if the scheduler queue contains an equal or+greater ammount of requests than the specified limit, the new requests+(generated by the spider) will be ignored.+The limit is setted from the spider attribute "requests_queue_size". If notfound, from the scrapy setting "REQUESTS_QUEUE_SIZE". If not found, no limitwill be applied. If given a value of 0, no limit will be applied."""+from scrapy.core.engine import scrapyenginefrom scrapy.conf import settingsfrom scrapy.http import Requestdiff --git a/scrapy/trunk/scrapy/contrib/spidermiddleware/offsite.py b/scrapy/trunk/scrapy/contrib/spidermiddleware/offsite.pyindex 754d2276e..f3cc9c485 100644--- a/scrapy/trunk/scrapy/contrib/spidermiddleware/offsite.py+++ b/scrapy/trunk/scrapy/contrib/spidermiddleware/offsite.py@@ -1,3 +1,8 @@+"""+OffsiteMiddleware: Filters out Requests for URLs outside the domains covered by+the spider.+"""+from scrapy.core import logfrom scrapy.http import Requestfrom scrapy.utils.url import url_is_from_spiderdiff --git a/scrapy/trunk/scrapy/contrib/spidermiddleware/referer.py b/scrapy/trunk/scrapy/contrib/spidermiddleware/referer.pyindex 8d16093ed..ec2db9e9c 100644--- a/scrapy/trunk/scrapy/contrib/spidermiddleware/referer.py+++ b/scrapy/trunk/scrapy/contrib/spidermiddleware/referer.py@@ -1,7 +1,11 @@+"""+RefererMiddleware: populates Request referer field, based on the Response which+originated it.+"""+from scrapy.core import logfrom scrapy.http import Request-class CrawlMiddleware(object):def process_result(self, response, result, spider):def _set_referer(r):diff --git a/scrapy/trunk/scrapy/contrib/spidermiddleware/restrict.py b/scrapy/trunk/scrapy/contrib/spidermiddleware/restrict.pyindex 22bd28fb3..b4eceef31 100644--- a/scrapy/trunk/scrapy/contrib/spidermiddleware/restrict.py+++ b/scrapy/trunk/scrapy/contrib/spidermiddleware/restrict.py@@ -1,5 +1,5 @@"""-Scrapemiddlware to restrict crawling to only some particular URLs+RestrictMiddleware: restricts crawling to fixed set of particular URLs"""from scrapy.http import Requestdiff --git a/scrapy/trunk/scrapy/contrib/spidermiddleware/urllength.py b/scrapy/trunk/scrapy/contrib/spidermiddleware/urllength.pyindex 07dd8d5f3..a0ad4375a 100644--- a/scrapy/trunk/scrapy/contrib/spidermiddleware/urllength.py+++ b/scrapy/trunk/scrapy/contrib/spidermiddleware/urllength.py@@ -1,11 +1,13 @@+"""+UrlLengthMiddleware: Filters out requests with URLs longer than URLLENGTH_LIMIT+"""+from scrapy.core import logfrom scrapy.http import Requestfrom scrapy.core.exceptions import NotConfiguredfrom scrapy.conf import settingsclass UrlLengthMiddleware(object):- """This middleware discard requests with URLs longer than URLLENGTH_LIMIT"""-def __init__(self):self.maxlength = settings.getint('URLLENGTH_LIMIT')if not self.maxlength: