MCPcopy Create free account
hub / github.com/ipython/ipython / copy_config_file

Method copy_config_file

IPython/core/profiledir.py:136–150  ·  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, path=None, overwrite=False)

Source from the content-addressed store, hash-verified

134 self.check_startup_dir()
135
136 def copy_config_file(self, config_file, path=None, overwrite=False):
137 """Copy a default config file into the active profile directory.
138
139 Default configuration files are kept in :mod:`IPython.core.profile`.
140 This function moves these from that location to the working profile
141 directory.
142 """
143 dst = os.path.join(self.location, config_file)
144 if os.path.isfile(dst) and not overwrite:
145 return False
146 if path is None:
147 path = os.path.join(get_ipython_package_dir(), u'core', u'profile', u'default')
148 src = os.path.join(path, config_file)
149 shutil.copy(src, dst)
150 return True
151
152 @classmethod
153 def create_profile_dir(cls, profile_dir, config=None):

Callers 1

init_config_filesMethod · 0.80

Calls 2

get_ipython_package_dirFunction · 0.50
copyMethod · 0.45

Tested by

no test coverage detected