Commit ff2048d 1 parent 1d8f501 commit ff2048d Copy full SHA for ff2048d
File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 19
19
import click
20
20
import os
21
21
22
+ from siibra .retrieval .requests import SiibraHttpRequestError
23
+
22
24
# ---- Autocompletion
23
25
24
26
@@ -143,14 +145,16 @@ def template(ctx, space):
143
145
img .to_filename (fname )
144
146
click .echo (f"Output written to { fname } ." )
145
147
148
+
146
149
@get .command ()
147
150
def ebrainstoken ():
148
151
"""Retrieve a parcellation map in the given space"""
149
152
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 )
154
158
155
159
156
160
# ---- Searching for things
Original file line number Diff line number Diff line change @@ -740,7 +740,7 @@ class ContinuousParcellationVolume(ParcellationVolume):
740
740
741
741
# A gitlab instance with holds precomputed sparse indices
742
742
_GITLAB_SERVER = 'https://jugit.fz-juelich.de'
743
- _GITLAB_PROJECT = 5779
743
+ _GITLAB_PROJECT = 5779
744
744
745
745
def __init__ (self , parcellation , space ):
746
746
@@ -812,7 +812,7 @@ def _load_index(self):
812
812
if conn is None :
813
813
conn = GitlabConnector (self ._GITLAB_SERVER , self ._GITLAB_PROJECT , 'main' )
814
814
files = conn .search_files ()
815
- bname = path .basename (fname )
815
+ bname = path .basename (fname )
816
816
if bname in files :
817
817
logger .debug (f"Retrieving precomputed index for { self .parcellation .name } " )
818
818
raw = conn .get (bname , decode_func = lambda b : b )
You can’t perform that action at this time.
0 commit comments