Skip to content

Commit

Permalink
try to placate pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanneBogart committed Aug 17, 2024
1 parent 4ee8261 commit 182c598
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions GCRCatalogs/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from .catalog_helpers import load_yaml_local, load_yaml
from .base_config import BaseConfig, BaseConfigManager
from .dr_register import DR_AVAILABLE
if DR_AVAILABLE:
from .dr_register import DrConfigRegister

__all__ = [
"get_root_dir", "set_root_dir", "remove_root_dir_default",
Expand Down Expand Up @@ -380,6 +378,8 @@ def set_config_source(dr=False, dr_root=None, dr_schema="production",
The original values will still be used.
"""
if dr and DR_AVAILABLE:
from .dr_register import DrConfigRegister

dr_params = _dr_params(dr_root, dr_schema, dr_site)
for elt in ConfigSource.dr_sources:
if elt[1] == dr_params:
Expand Down Expand Up @@ -411,12 +411,16 @@ def resume_config_source(config_source):
if isinstance(config_source, ConfigRegister):
ConfigSource.config_source = config_source
return config_source
elif isinstance(config_source, DrConfigRegister):
for elt in ConfigSource.dr_sources:
if config_source == elt[0]:
ConfigSource.config_source = config_source
return config_source
else:
raise ValueError("Unknown config source")

if DR_AVAILABLE:
from .dr_register import DrConfigRegister

if isinstance(config_source, DrConfigRegister):
for elt in ConfigSource.dr_sources:
if config_source == elt[0]:
ConfigSource.config_source = config_source
return config_source
else:
raise ValueError("Unknown config source")
else:
raise ValueError("Improper argument to ConfigSource.resume_config_source")

0 comments on commit 182c598

Please sign in to comment.