From d9a40571d1a287d94911b25a5b5df10588b1d4a0 Mon Sep 17 00:00:00 2001 From: Stefan Karner Date: Tue, 7 May 2019 15:55:06 +0200 Subject: [PATCH] Remove dead code, fix docstrings, fix identifiers --- webarchiv.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/webarchiv.py b/webarchiv.py index 58a09f7..ea466ba 100644 --- a/webarchiv.py +++ b/webarchiv.py @@ -123,7 +123,6 @@ class WebarchivSession: elif r.status_code == 410: print('The requested API Version (via X-API-VERSION Header) is not available', file=sys.stderr) return r - raise HTTPError(response=r) def fulltext_search(self, query_string, from_=None, to_=None): """ @@ -195,15 +194,17 @@ class WebarchivSession: """ this is the pollingrequest for the given typen of request - :param response: String to search for + :param resp: String to search for :return: response """ requestid = resp.json()['requestid'] - type = resp.json()['type'] - if type == 1: + type_ = resp.json()['type'] + if type_ == 1: r = self._get(op='/search/status/fulltext', params={'requestid': requestid}) - elif type == 2: + elif type_ == 2: r = self._get(op='/search/status/wayback', params={'requestid': requestid}) + else: + raise NotImplementedError(f'Unknown status query type {type_} - Please update client.') return r @@ -235,8 +236,6 @@ class WebarchivSession: Start a domain name search in the Webarchive. :param query_string: String to search for - :param page_: The page number parameter works with the page size parameter to control the offset of the records returned in the results. Default value is 1 - :param pagesize_: The page size parameter works with the page number parameter to control the offset of the records returned in the results. It also controls how many results are returned with each request. Default value is 10 :return: result as json """ params = {'q': query_string} -- GitLab