-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from flairNLP/unbatch-fundus
Unbatch Fundus
- Loading branch information
Showing
35 changed files
with
895 additions
and
1,047 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
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,41 +1,20 @@ | ||
import pathlib | ||
import sys | ||
|
||
from fundus.publishers import PublisherCollection | ||
from fundus.scraping.common_crawl import CCNewsCrawler | ||
from fundus.scraping.crawler import CCNewsCrawler, Crawler, CrawlerBase | ||
from fundus.scraping.filter import Requires | ||
from fundus.scraping.html import NewsMap, RSSFeed, Sitemap | ||
from fundus.scraping.pipeline import BaseCrawler, Crawler | ||
from fundus.scraping.url import NewsMap, RSSFeed, Sitemap | ||
|
||
__module_path__ = pathlib.Path(__file__).parent | ||
__development_base_path__ = __module_path__.parents[1] | ||
|
||
__all__ = [ | ||
"CrawlerBase", | ||
"Crawler", | ||
"BaseCrawler", | ||
"CCNewsCrawler", | ||
"PublisherCollection", | ||
"Requires", | ||
"RSSFeed", | ||
"Sitemap", | ||
"NewsMap", | ||
] | ||
|
||
# On a Windows machines, when executing `BaseCrawler.crawl` from our sync API two times, | ||
# Python throws an `RuntimeError: Event loop is closed exception` during Python's clean-up phase. | ||
|
||
# To reproduce the error run the following code: | ||
# from fundus import Crawler, PublisherCollection | ||
# crawler = Crawler(PublisherCollection.de.DieWelt) | ||
# for article in crawler.crawl(max_articles=1): | ||
# pass | ||
# for article in crawler.crawl(max_articles=1): | ||
# pass | ||
|
||
# A workaround involves to modify the event loop policy of asyncio on Windows machines. | ||
# Unfortunately, this is a global modification. For further information see: | ||
# https://stackoverflow.com/questions/45600579/asyncio-event-loop-is-closed-when-getting-loop | ||
if sys.platform == "win32": | ||
import asyncio | ||
|
||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) |
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
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
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.