Skip to content

Commit

Permalink
wsp: minor fix
Browse files Browse the repository at this point in the history
* Adds: makes staticmethod `_get_collections` class method.
* Adds: minor indentation fix.
* Removes: unused import.

Signed-off-by: Spiros Delviniotis <[email protected]>
  • Loading branch information
spirosdelviniotis committed Aug 18, 2017
1 parent 5de385f commit c6a027a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hepcrawl/spiders/wsp_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import os
import urlparse
import tempfile
import shutil

from scrapy import Request
from scrapy.spiders import XMLFeedSpider
Expand Down Expand Up @@ -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']
Expand Down

0 comments on commit c6a027a

Please sign in to comment.