Skip to content
Snippets Groups Projects
Commit aa7c5b4a authored by gabriele-h's avatar gabriele-h
Browse files

Make startRecord a variable

parent 02a41f71
No related branches found
No related tags found
No related merge requests found
......@@ -82,19 +82,19 @@ class RecordRetriever:
:raises SruDiagnostics: if SRU returns an error
"""
sru_url = self._create_url(alma_query)
startrecord = '0'
response = request.urlopen(sru_url).read()
sru_xml = fromstring(response)
sru_url = self._create_url(alma_query, startrecord)
sru_xml = self._response_to_xml(sru_url)
self._raise_errors_single_records(sru_xml)
xml_list = self._extract_marc_xml(sru_xml)
return xml_list[0]
def _create_url(self, alma_query: str) -> str:
def _create_url(self, alma_query: str, startrecord: str) -> str:
self.url_query['startRecord'] = '0'
self.url_query['startRecord'] = startrecord
self.url_query['maximumRecords'] = '1'
self.url_query['query'] = alma_query
url_query_string = parse.urlencode(self.url_query)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment