Merge pull request #2595 from Lodour/master

Add omitted "self" arguments
This commit is contained in:
Mikhail Korobov 2017-02-25 13:12:21 +05:00 committed by GitHub
commit d6a8288a48
1 changed files with 4 additions and 4 deletions

View File

@ -20,14 +20,14 @@ class ${ProjectName}SpiderMiddleware(object):
crawler.signals.connect(s.spider_opened, signal=signals.spider_opened)
return s
def process_spider_input(response, spider):
def process_spider_input(self, response, spider):
# Called for each response that goes through the spider
# middleware and into the spider.
# Should return None or raise an exception.
return None
def process_spider_output(response, result, spider):
def process_spider_output(self, response, result, spider):
# Called with the results returned from the Spider, after
# it has processed the response.
@ -35,7 +35,7 @@ class ${ProjectName}SpiderMiddleware(object):
for i in result:
yield i
def process_spider_exception(response, exception, spider):
def process_spider_exception(self, response, exception, spider):
# Called when a spider or process_spider_input() method
# (from other spider middleware) raises an exception.
@ -43,7 +43,7 @@ class ${ProjectName}SpiderMiddleware(object):
# or Item objects.
pass
def process_start_requests(start_requests, spider):
def process_start_requests(self, start_requests, spider):
# Called with the start requests of the spider, and works
# similarly to the process_spider_output() method, except
# that it doesnt have a response associated.