Skip to content

Commit

Permalink
more readable implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
whalebot-helmsman committed Feb 19, 2020
1 parent 15badc4 commit 67146b2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scrapy/spiders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,17 @@ def start_requests(self):
yield Request(url, dont_filter=True)

def start_requests_with_control(self):
sig = self.WaitUntilQueueEmpty
gen_ = ((r, sig) if r != sig else (r,) for r in self.start_requests())
return iflatten(gen_)

def gen_():
sig = self.WaitUntilQueueEmpty

for r in self.start_requests():
if r != sig:
yield (r, sig)
else:
yield (r,)

return iflatten(gen_())

def make_requests_from_url(self, url):
""" This method is deprecated. """
Expand Down

0 comments on commit 67146b2

Please sign in to comment.