Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pubchempy.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ def request(identifier, namespace='cid', domain='compound', operation=None, outp
def get(identifier, namespace='cid', domain='compound', operation=None, output='JSON', searchtype=None, **kwargs):
"""Request wrapper that automatically handles async requests."""
if (searchtype and searchtype != 'xref') or namespace in ['formula']:
response = request(identifier, namespace, domain, None, 'JSON', searchtype, **kwargs).read()
# BalooRM - if searchtype == 'fastidentity', pass operation in place of None
if searchtype == 'fastidentity':
response = request(identifier, namespace, domain, operation, 'JSON', searchtype, **kwargs).read()
else:
response = request(identifier, namespace, domain, None, 'JSON', searchtype, **kwargs).read()
status = json.loads(response.decode())
if 'Waiting' in status and 'ListKey' in status['Waiting']:
identifier = status['Waiting']['ListKey']
Expand Down