Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions solvebio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ def emit(self, record):

_init_logging()


"""
This is a cached value of client._host, and is kept in for backwards compatibility
Use this with caution, as you should prefer relying on get_api_host() instead
"""
api_host = None


def _set_cached_api_host(host):
global api_host
api_host = host


from .version import VERSION # noqa
from .errors import SolveError
from .query import Query, BatchQuery, Filter, GenomicFilter
Expand Down Expand Up @@ -178,9 +191,15 @@ def whoami():


def get_api_host():
global api_host
api_host = client._host

return client._host


get_api_host()


__all__ = [
'Annotator',
'Application',
Expand Down
3 changes: 2 additions & 1 deletion solvebio/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def authenticate(

# TODO: warn user if WWW url is provided in edp_login!

# @TODO: remove references to solvebio.api_host, etc...
from solvebio import _set_cached_api_host
_set_cached_api_host(host)

return host, auth

Expand Down
Loading