Skip to content

Commit

Permalink
Merge pull request #190 from jkowalleck/master
Browse files Browse the repository at this point in the history
slight improv in ImageCrawler deduplication checks
  • Loading branch information
jkowalleck authored Jan 28, 2020
2 parents c343f60 + fd000f5 commit 3913b78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nichtparasoup/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _add_image_to_blacklist(self, image: Image) -> None:
self.blacklist.add(image.uri)

def has_imagecrawler(self, imagecrawler: BaseImageCrawler) -> bool:
return imagecrawler in [crawler.imagecrawler for crawler in self.crawlers]
return imagecrawler in (crawler.imagecrawler for crawler in self.crawlers)

def add_imagecrawler(self, imagecrawler: BaseImageCrawler, weight: _CrawlerWeight) -> None:
self.crawlers.append(Crawler(
Expand Down
2 changes: 1 addition & 1 deletion nichtparasoup/testing/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ConfigFileTest(TestCase):
def validate(self, file: str) -> None:
config = parse_yaml_file(file)
self.assertIsInstance(config, dict)
imagecrawlers = [] # type: List[BaseImageCrawler]
imagecrawlers = list() # type: List[BaseImageCrawler]
for crawler_config in config['crawlers']:
imagecrawler = get_imagecrawler(crawler_config)
self.assertNotIn(imagecrawler, imagecrawlers, msg='Duplicate ImageCrawler')
Expand Down

0 comments on commit 3913b78

Please sign in to comment.