mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
more profile awareness from config.manager to IPython subclass
also enables specifying profile by name, instead of full path.
This commit is contained in:
parent
5d65feecef
commit
849e752d3d
@ -3,12 +3,19 @@
|
||||
# Copyright (c) IPython Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
import os
|
||||
|
||||
from IPython.config.manager import BaseJSONConfigManager
|
||||
from IPython.utils.path import locate_profile
|
||||
from IPython.utils.traitlets import Unicode
|
||||
|
||||
class ConfigManager(BaseJSONConfigManager):
|
||||
"""Config Manager used for storing notebook frontend config"""
|
||||
|
||||
profile = Unicode('default', config=True)
|
||||
|
||||
profile_dir = Unicode(config=True)
|
||||
|
||||
def _profile_dir_default(self):
|
||||
return locate_profile(self.profile)
|
||||
|
||||
def _config_dir(self):
|
||||
return os.path.join(self.profile_dir, 'nbconfig')
|
||||
def _config_dir_default(self):
|
||||
return self.profile_dir
|
||||
|
Loading…
Reference in New Issue
Block a user