@@ -174,25 +174,23 @@ def get(template, raise_empty=False, **kwargs):
174174 not_fetched = [str (p ) for p in out_file if not p .is_file () or p .stat ().st_size == 0 ]
175175
176176 if not_fetched :
177- msg = 'Could not fetch template files: %s.' % ', ' .join (not_fetched )
177+ msg = 'Could not fetch template files: {}.' . format ( ', ' .join (not_fetched ) )
178178 if dl_missing and not TF_USE_DATALAD :
179179 msg += (
180- """\
181- The $TEMPLATEFLOW_HOME folder %s seems to contain an initiated DataLad \
180+ f """\
181+ The $TEMPLATEFLOW_HOME folder { TF_LAYOUT . root } seems to contain an initiated DataLad \
182182 dataset, but the environment variable $TEMPLATEFLOW_USE_DATALAD is not \
183183 set or set to one of (false, off, 0). Please set $TEMPLATEFLOW_USE_DATALAD \
184184 on (possible values: true, on, 1)."""
185- % TF_LAYOUT .root
186185 )
187186
188187 if s3_missing and TF_USE_DATALAD :
189188 msg += (
190- """\
191- The $TEMPLATEFLOW_HOME folder %s seems to contain an plain \
189+ f """\
190+ The $TEMPLATEFLOW_HOME folder { TF_LAYOUT . root } seems to contain an plain \
192191 dataset, but the environment variable $TEMPLATEFLOW_USE_DATALAD is \
193192 set to one of (true, on, 1). Please set $TEMPLATEFLOW_USE_DATALAD \
194193 off (possible values: false, off, 0)."""
195- % TF_LAYOUT .root
196194 )
197195
198196 raise RuntimeError (msg )
@@ -249,7 +247,7 @@ def get_metadata(template):
249247
250248 """
251249 tf_home = Path (TF_LAYOUT .root )
252- filepath = tf_home / ('tpl-%s' % template ) / 'template_description.json'
250+ filepath = tf_home / (f 'tpl-{ template } ' ) / 'template_description.json'
253251
254252 # Ensure that template is installed and file is available
255253 if not filepath .is_file ():
@@ -322,7 +320,7 @@ def _s3_get(filepath):
322320 path = filepath .relative_to (TF_LAYOUT .root ).as_posix ()
323321 url = f'{ TF_S3_ROOT } /{ path } '
324322
325- print ('Downloading %s' % url , file = stderr )
323+ print (f 'Downloading { url } ' , file = stderr )
326324 # Streaming, so we can iterate over the response.
327325 r = requests .get (url , stream = True , timeout = TF_GET_TIMEOUT )
328326
0 commit comments