Skip to content

Commit

Permalink
Check not necessary for internal classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-E-Rose committed Jun 20, 2019
1 parent b0b0a48 commit b98c482
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pybliometrics/scopus/classes/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,10 @@ def __init__(self, query, api, refresh, view='STANDARD', count=200,
ValueError
If the api parameteris an invalid entry.
"""
# Checks
if api not in SEARCH_URL:
raise ValueError('api parameter must be one of ' +
', '.join(SEARCH_URL.keys()))

# Read the file contents if file exists and we are not refreshing,
# otherwise download query anew and cache file
qfile = join(get_folder(api, view), md5(query.encode('utf8')).hexdigest())
fname = md5(query.encode('utf8')).hexdigest()
qfile = join(get_folder(api, view), fname)
if not refresh and exists(qfile):
with open(qfile, "rb") as f:
self._json = [loads(line) for line in f.readlines()]
Expand Down

0 comments on commit b98c482

Please sign in to comment.