diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-02-13 13:51:50 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-02-13 13:51:59 +0300 |
commit | 7a513da9d8c2b409bc0655c232b1b58c24e66164 (patch) | |
tree | 28359b8734f76cfc4228cfa9332594e19600b7c4 /blender_id/communication.py | |
parent | fa7f7ca3ba34ae832666d45f7ce37af5a4dc3946 (diff) |
Show which Blender ID instance is communicated with in the addon prefs
This is only shown if it was overridden by setting the
BLENDER_ID_ENDPOINT environment variable. It makes Cloud development a
bit easier when it's explicit to which Blender ID (local dev or real
one) we're talking.
Diffstat (limited to 'blender_id/communication.py')
-rw-r--r-- | blender_id/communication.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/blender_id/communication.py b/blender_id/communication.py index 9960c338..65fdf4cf 100644 --- a/blender_id/communication.py +++ b/blender_id/communication.py @@ -24,6 +24,9 @@ import typing log = logging.getLogger(__name__) +# Can be overridden by setting the environment variable BLENDER_ID_ENDPOINT. +BLENDER_ID_ENDPOINT = 'https://www.blender.org/id/' + class BlenderIdCommError(RuntimeError): """Raised when there was an error communicating with Blender ID""" @@ -59,7 +62,7 @@ def blender_id_endpoint(endpoint_path=None): if base_url: log.warning('Using overridden Blender ID url %s', base_url) else: - base_url = 'https://www.blender.org/id/' + base_url = BLENDER_ID_ENDPOINT log.info('Using standard Blender ID url %s', base_url) # urljoin() is None-safe for the 2nd parameter. |