Show More
@@ -8,7 +8,6 b' import json' | |||||
8 | import os |
|
8 | import os | |
9 |
|
9 | |||
10 | from IPython.config import LoggingConfigurable |
|
10 | from IPython.config import LoggingConfigurable | |
11 | from IPython.utils.path import locate_profile |
|
|||
12 | from IPython.utils.py3compat import PY3 |
|
11 | from IPython.utils.py3compat import PY3 | |
13 | from IPython.utils.traitlets import Unicode |
|
12 | from IPython.utils.traitlets import Unicode | |
14 |
|
13 | |||
@@ -35,22 +34,12 b' def recursive_update(target, new):' | |||||
35 |
|
34 | |||
36 |
|
35 | |||
37 | class BaseJSONConfigManager(LoggingConfigurable): |
|
36 | class BaseJSONConfigManager(LoggingConfigurable): | |
38 |
"""General config manager |
|
37 | """General JSON config manager | |
39 |
|
38 | |||
40 | Deals with persisting/storing config in a json file |
|
39 | Deals with persisting/storing config in a json file | |
41 | in IPython profile |
|
|||
42 | """ |
|
40 | """ | |
43 |
|
41 | |||
44 |
|
|
42 | config_dir = Unicode('.') | |
45 | def _profile_dir_default(self): |
|
|||
46 | return locate_profile() |
|
|||
47 |
|
||||
48 | @property |
|
|||
49 | def config_dir(self): |
|
|||
50 | return self._config_dir() |
|
|||
51 |
|
||||
52 | def _config_dir(self): |
|
|||
53 | return self.profile_dir |
|
|||
54 |
|
43 | |||
55 | def ensure_config_dir_exists(self): |
|
44 | def ensure_config_dir_exists(self): | |
56 | try: |
|
45 | try: |
@@ -3,12 +3,19 b'' | |||||
3 | # Copyright (c) IPython Development Team. |
|
3 | # Copyright (c) IPython Development Team. | |
4 | # Distributed under the terms of the Modified BSD License. |
|
4 | # Distributed under the terms of the Modified BSD License. | |
5 |
|
5 | |||
6 | import os |
|
|||
7 |
|
||||
8 | from IPython.config.manager import BaseJSONConfigManager |
|
6 | from IPython.config.manager import BaseJSONConfigManager | |
|
7 | from IPython.utils.path import locate_profile | |||
|
8 | from IPython.utils.traitlets import Unicode | |||
9 |
|
9 | |||
10 | class ConfigManager(BaseJSONConfigManager): |
|
10 | class ConfigManager(BaseJSONConfigManager): | |
11 | """Config Manager used for storing notebook frontend config""" |
|
11 | """Config Manager used for storing notebook frontend config""" | |
|
12 | ||||
|
13 | profile = Unicode('default', config=True) | |||
|
14 | ||||
|
15 | profile_dir = Unicode(config=True) | |||
|
16 | ||||
|
17 | def _profile_dir_default(self): | |||
|
18 | return locate_profile(self.profile) | |||
12 |
|
19 | |||
13 | def _config_dir(self): |
|
20 | def _config_dir_default(self): | |
14 |
return |
|
21 | return self.profile_dir |
General Comments 0
You need to be logged in to leave comments.
Login now