forked from scrapy/scrapy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop support for scrapy.project.crawler (And scrapy.stats consequently)
- Loading branch information
Showing
9 changed files
with
22 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
|
||
""" | ||
Obsolete module, kept for giving a meaningful error message when trying to | ||
import. | ||
""" | ||
--------- WARNING: THIS MODULE IS DEPRECATED ----------- | ||
|
||
This module is deprecated. If you want to get the Scrapy crawler from your | ||
extension, middleware or pipeline implement the `from_crawler` class method. | ||
raise ImportError("""scrapy.project usage has become obsolete. | ||
If you want to get the Scrapy crawler from your extension, middleware or | ||
pipeline implement the `from_crawler` class method (or look up for extending | ||
components that have already done it, such as spiders). | ||
For example: | ||
@classmethod | ||
def from_crawler(cls, crawler): | ||
return cls(crawler) | ||
""" | ||
return cls(crawler)""") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from scrapy.project import crawler | ||
stats = crawler.stats | ||
|
||
import warnings | ||
from scrapy.exceptions import ScrapyDeprecationWarning | ||
warnings.warn("Module `scrapy.stats` is deprecated, use `crawler.stats` attribute instead", | ||
ScrapyDeprecationWarning, stacklevel=2) | ||
""" | ||
Obsolete module, kept for giving a meaningful error message when trying to | ||
import. | ||
""" | ||
|
||
raise ImportError("scrapy.stats usage has become obsolete, use " | ||
"`crawler.stats` attribute instead") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters