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)
| 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): |
no test coverage detected