mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_23.2' into release_24.0
This commit is contained in:
@@ -54,12 +54,13 @@ class ApiBiotoolsMetadataSource(BiotoolsMetadataSource):
|
||||
|
||||
def _raw_get_metadata(self, biotools_reference) -> Optional[str]:
|
||||
api_url = f"https://bio.tools/api/tool/{biotools_reference}?format=json"
|
||||
req = requests.get(api_url, timeout=DEFAULT_SOCKET_TIMEOUT)
|
||||
req.encoding = req.apparent_encoding
|
||||
if req.status_code == 404:
|
||||
return None
|
||||
else:
|
||||
try:
|
||||
req = requests.get(api_url, timeout=DEFAULT_SOCKET_TIMEOUT)
|
||||
req.raise_for_status()
|
||||
req.encoding = req.apparent_encoding
|
||||
return req.text
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
def get_biotools_metadata(self, biotools_reference: str) -> Optional[BiotoolsEntry]:
|
||||
createfunc = functools.partial(self._raw_get_metadata, biotools_reference)
|
||||
|
||||
Reference in New Issue
Block a user