lister/gnu: Remove unneeded get_file method

This commit is contained in:
Antoine R. Dumont (@ardumont) 2019-10-04 11:02:17 +02:00
parent 322c9dc7e2
commit 00bb6c7bbf
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8

View file

@ -38,31 +38,25 @@ class GNULister(SimpleLister):
origin_url,
tarballs=self.tarballs[kwargs.get('name')])
def get_file(self):
def safely_issue_request(self, identifier):
'''
Download and unzip tree.json.gz file and returns its content
in JSON format
Returns
File content in dictionary format
Args:
identifier: resource identifier (unused)
Returns:
Server response
'''
response = requests.get(self.TREE_URL,
allow_redirects=True)
uncompressed_content = gzip.decompress(response.content)
return json.loads(uncompressed_content.decode('utf-8'))
def safely_issue_request(self, identifier):
'''
Make network request to download the file which
has file structure of the GNU website.
Args:
identifier: resource identifier
Returns:
Server response
'''
return self.get_file()
def list_packages(self, response):
"""
List the actual gnu origins with their names,url and the list