MCPcopy Index your code
hub / github.com/ipython/ipython / copy_config_file

Method copy_config_file

IPython/core/profiledir.py:156–171  ·  view source on GitHub ↗

Copy a default config file into the active profile directory. Default configuration files are kept in :mod:`IPython.core.profile`. This function moves these from that location to the working profile directory.

(self, config_file: str, path: Path, overwrite=False)

Source from the content-addressed store, hash-verified

154 self.check_startup_dir()
155
156 def copy_config_file(self, config_file: str, path: Path, overwrite=False) -> bool:
157 """Copy a default config file into the active profile directory.
158
159 Default configuration files are kept in :mod:`IPython.core.profile`.
160 This function moves these from that location to the working profile
161 directory.
162 """
163 dst = Path(os.path.join(self.location, config_file))
164 if dst.exists() and not overwrite:
165 return False
166 if path is None:
167 path = os.path.join(get_ipython_package_dir(), u'core', u'profile', u'default')
168 assert isinstance(path, Path)
169 src = path / config_file
170 shutil.copy(src, dst)
171 return True
172
173 @classmethod
174 def create_profile_dir(cls, profile_dir, config=None):

Callers 1

init_config_filesMethod · 0.80

Calls 2

get_ipython_package_dirFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected