|
14 | 14 | import matplotlib as mpl
|
15 | 15 | from matplotlib import cm
|
16 | 16 |
|
17 |
| -from .config import config |
18 |
| - |
19 | 17 | logger = logging.getLogger('surfer')
|
20 | 18 |
|
21 | 19 |
|
@@ -228,7 +226,7 @@ def set_log_level(verbose=None, return_old_level=False):
|
228 | 226 | If True, return the old verbosity level.
|
229 | 227 | """
|
230 | 228 | if verbose is None:
|
231 |
| - verbose = config.get('options', 'logging_level') |
| 229 | + verbose = "INFO" |
232 | 230 | elif isinstance(verbose, bool):
|
233 | 231 | if verbose is True:
|
234 | 232 | verbose = 'INFO'
|
@@ -601,19 +599,14 @@ def _get_subjects_dir(subjects_dir=None, raise_error=True):
|
601 | 599 | subjects_dir : str
|
602 | 600 | The subjects directory. If the subjects_dir input parameter is not
|
603 | 601 | 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. |
606 | 603 | """
|
607 | 604 | 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.') |
617 | 610 |
|
618 | 611 | if raise_error and not os.path.exists(subjects_dir):
|
619 | 612 | raise ValueError('The subjects directory %s does not exist.'
|
|
0 commit comments