Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 19, 2024
1 parent 6758119 commit ff5d158
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions jupyterlab_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_static_page_config(
app_settings_dir: str | None = None, # noqa: ARG001
logger: Logger | None = None, # noqa: ARG001
level: str = "all",
include_higher_levels: bool = False
include_higher_levels: bool = False,
) -> dict[str, Any]:
"""Get the static page config for JupyterLab
Expand Down Expand Up @@ -362,7 +362,8 @@ def _default_translations_api_url(self) -> str:
def get_allowed_levels() -> list[str]:
return ["all", "user", "sys_prefix", "system", "app", "extension"]

def _get_config_manager(level: str, include_higher_levels: bool=False) -> ConfigManager:

def _get_config_manager(level: str, include_higher_levels: bool = False) -> ConfigManager:
"""Get the location of config files for the current context
Returns the string to the environment
"""
Expand All @@ -372,18 +373,20 @@ def _get_config_manager(level: str, include_higher_levels: bool=False) -> Config
raise ValueError(msg)

config_name = "labconfig"

if level == "all":
return ConfigManager(config_dir_name=config_name)

paths = {"app": [],
"system": SYSTEM_CONFIG_PATH,
"sys_prefix": [ENV_CONFIG_PATH[0]],
"user": [jupyter_config_dir()],
"extension": []}
paths = {
"app": [],
"system": SYSTEM_CONFIG_PATH,
"sys_prefix": [ENV_CONFIG_PATH[0]],
"user": [jupyter_config_dir()],
"extension": [],
}

if include_higher_levels:
levels = allowed[allowed.index(level):]
levels = allowed[allowed.index(level) :]
else:
levels = [level]

Expand Down

0 comments on commit ff5d158

Please sign in to comment.