Skip to content

Commit ff2048d

Browse files
committed
minor changes
1 parent 1d8f501 commit ff2048d

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

cli/cli.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import click
2020
import os
2121

22+
from siibra.retrieval.requests import SiibraHttpRequestError
23+
2224
# ---- Autocompletion
2325

2426

@@ -143,14 +145,16 @@ def template(ctx, space):
143145
img.to_filename(fname)
144146
click.echo(f"Output written to {fname}.")
145147

148+
146149
@get.command()
147150
def ebrainstoken():
148151
"""Retrieve a parcellation map in the given space"""
149152
import siibra
150-
siibra.fetch_ebrains_token()
151-
os.environ['HBP_AUTH_TOKEN'] = siibra.EbrainsRequest._KG_API_TOKEN
152-
print("Set new EBRAINS KG access token to $HBP_AUTH_TOKEN. The token is:")
153-
print(os.environ['HBP_AUTH_TOKEN'])
153+
try:
154+
siibra.fetch_ebrains_token()
155+
print(siibra.EbrainsRequest._KG_API_TOKEN)
156+
except SiibraHttpRequestError:
157+
exit(1)
154158

155159

156160
# ---- Searching for things

siibra/volumes/parcellationmap.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ class ContinuousParcellationVolume(ParcellationVolume):
740740

741741
# A gitlab instance with holds precomputed sparse indices
742742
_GITLAB_SERVER = 'https://jugit.fz-juelich.de'
743-
_GITLAB_PROJECT = 5779
743+
_GITLAB_PROJECT = 5779
744744

745745
def __init__(self, parcellation, space):
746746

@@ -812,7 +812,7 @@ def _load_index(self):
812812
if conn is None:
813813
conn = GitlabConnector(self._GITLAB_SERVER, self._GITLAB_PROJECT, 'main')
814814
files = conn.search_files()
815-
bname = path.basename(fname)
815+
bname = path.basename(fname)
816816
if bname in files:
817817
logger.debug(f"Retrieving precomputed index for {self.parcellation.name}")
818818
raw = conn.get(bname, decode_func=lambda b: b)

0 commit comments

Comments
 (0)