Skip to content

Commit b846ee4

Browse files
committed
Remove config file references from surfer.utils
1 parent 5fcc624 commit b846ee4

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

surfer/utils.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import matplotlib as mpl
1515
from matplotlib import cm
1616

17-
from .config import config
18-
1917
logger = logging.getLogger('surfer')
2018

2119

@@ -228,7 +226,7 @@ def set_log_level(verbose=None, return_old_level=False):
228226
If True, return the old verbosity level.
229227
"""
230228
if verbose is None:
231-
verbose = config.get('options', 'logging_level')
229+
verbose = "INFO"
232230
elif isinstance(verbose, bool):
233231
if verbose is True:
234232
verbose = 'INFO'
@@ -601,19 +599,14 @@ def _get_subjects_dir(subjects_dir=None, raise_error=True):
601599
subjects_dir : str
602600
The subjects directory. If the subjects_dir input parameter is not
603601
None, its value will be returned, otherwise it will be obtained from
604-
the SUBJECTS_DIR environment variable. If that does not exist,
605-
it will be obtained from the configuration file.
602+
the SUBJECTS_DIR environment variable.
606603
"""
607604
if subjects_dir is None:
608-
if 'SUBJECTS_DIR' in os.environ:
609-
subjects_dir = os.environ['SUBJECTS_DIR']
610-
else:
611-
subjects_dir = config.get('options', 'subjects_dir')
612-
if raise_error and subjects_dir == '':
613-
raise ValueError('The subjects directory has to be specified '
614-
'using the subjects_dir parameter, the '
615-
'SUBJECTS_DIR environment variable, or the '
616-
'"subjects_dir" entry in the config file')
605+
subjects_dir = os.environ.get("SUBJECTS_DIR", "")
606+
if not subjects_dir and raise_error:
607+
raise ValueError('The subjects directory has to be specified '
608+
'using the subjects_dir parameter or the '
609+
'SUBJECTS_DIR environment variable.')
617610

618611
if raise_error and not os.path.exists(subjects_dir):
619612
raise ValueError('The subjects directory %s does not exist.'

0 commit comments

Comments
 (0)