diff --git a/IPython/config/profile/README_STARTUP b/IPython/config/profile/README_STARTUP new file mode 100644 index 0000000..61d4700 --- /dev/null +++ b/IPython/config/profile/README_STARTUP @@ -0,0 +1,11 @@ +This is the IPython startup directory + +.py and .ipy files in this directory will be run *prior* to any code or files specified +via the exec_lines or exec_files configurables whenever you load this profile. + +Files will be run in lexicographical order, so you can control the execution order of files +with a prefix, e.g.:: + + 00-first.py + 50-middle.py + 99-last.ipy diff --git a/IPython/core/profiledir.py b/IPython/core/profiledir.py index 7cc9e13..935dbf9 100644 --- a/IPython/core/profiledir.py +++ b/IPython/core/profiledir.py @@ -100,6 +100,10 @@ class ProfileDir(LoggingConfigurable): def check_startup_dir(self): if not os.path.isdir(self.startup_dir): os.mkdir(self.startup_dir) + readme = os.path.join(self.startup_dir, 'README') + src = os.path.join(get_ipython_package_dir(), u'config', u'profile', u'README_STARTUP') + if not os.path.exists(readme): + shutil.copy(src, readme) def _security_dir_changed(self, name, old, new): self.check_security_dir() @@ -129,6 +133,7 @@ class ProfileDir(LoggingConfigurable): self.check_security_dir() self.check_log_dir() self.check_pid_dir() + self.check_startup_dir() def copy_config_file(self, config_file, path=None, overwrite=False): """Copy a default config file into the active profile directory. diff --git a/setupbase.py b/setupbase.py index 0113f6d..8a7efa9 100644 --- a/setupbase.py +++ b/setupbase.py @@ -132,7 +132,7 @@ def find_package_data(): static_data.append(os.path.join(parent, f)) package_data = { - 'IPython.config.profile' : ['README', '*/*.py'], + 'IPython.config.profile' : ['README*', '*/*.py'], 'IPython.testing' : ['*.txt'], 'IPython.frontend.html.notebook' : ['templates/*'] + static_data, 'IPython.frontend.qt.console' : ['resources/icon/*.svg'],