From c6a027ab6b0631a1ffde85d7178bcb71e2329555 Mon Sep 17 00:00:00 2001 From: Spiros Delviniotis Date: Fri, 18 Aug 2017 14:44:14 +0200 Subject: [PATCH] wsp: minor fix * Adds: makes staticmethod `_get_collections` class method. * Adds: minor indentation fix. * Removes: unused import. Signed-off-by: Spiros Delviniotis --- hepcrawl/spiders/wsp_spider.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hepcrawl/spiders/wsp_spider.py b/hepcrawl/spiders/wsp_spider.py index 1f0786d3..5400621c 100644 --- a/hepcrawl/spiders/wsp_spider.py +++ b/hepcrawl/spiders/wsp_spider.py @@ -14,7 +14,6 @@ import os import urlparse import tempfile -import shutil from scrapy import Request from scrapy.spiders import XMLFeedSpider @@ -214,10 +213,12 @@ def parse_node(self, response, node): return parsed_record - def _get_collections(self, node, article_type, current_journal_title): + @staticmethod + def _get_collections(node, article_type, current_journal_title): """Return this articles' collection.""" conference = node.xpath('.//conference').extract() - if conference or current_journal_title == "International Journal of Modern Physics: Conference Series": + if conference or current_journal_title == "International Journal of Modern Physics:" \ + " Conference Series": return ['HEP', 'ConferencePaper'] elif article_type == "review-article": return ['HEP', 'Review']