Skip to content

Commit

Permalink
Locate the config using jupyter_core.paths.jupyter_config_dir()
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Nov 27, 2023
1 parent 59865fd commit 15452de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 10 additions & 2 deletions src/jupytext_config/jupytext_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

import sys
from argparse import ArgumentParser
from pathlib import Path

from .labconfig import DEFAULT_SETTINGS_FILE, LabConfig
import jupyter_core.paths as jupyter_core_paths

from .labconfig import LabConfig


class SubCommand:
Expand Down Expand Up @@ -86,7 +89,12 @@ def fill_parser(self, subparser):

def main():
parser = ArgumentParser()
parser.add_argument("--settings-file", default=DEFAULT_SETTINGS_FILE)
parser.add_argument(
"--settings-file",
default=Path(jupyter_core_paths.jupyter_config_dir())
/ "labconfig"
/ "default_setting_overrides.json",
)
subparsers = parser.add_subparsers(required=True)
for subcommand in SUBCOMMANDS:
subparser = subparsers.add_parser(subcommand.name, help=subcommand.help)
Expand Down
4 changes: 0 additions & 4 deletions src/jupytext_config/labconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
import logging
from pathlib import Path

DEFAULT_SETTINGS_FILE = (
Path.home() / ".jupyter" / "labconfig" / "default_setting_overrides.json"
)


class LabConfig:
DOCTYPES = [
Expand Down

0 comments on commit 15452de

Please sign in to comment.