Show More
@@ -37,7 +37,7 b' from IPython.config.loader import (' | |||||
37 | PyFileConfigLoader |
|
37 | PyFileConfigLoader | |
38 | ) |
|
38 | ) | |
39 | from IPython.lib import inputhook |
|
39 | from IPython.lib import inputhook | |
40 | from IPython.utils.path import filefind, get_ipython_dir |
|
40 | from IPython.utils.path import filefind, get_ipython_dir, check_for_old_config | |
41 | from IPython.core import usage |
|
41 | from IPython.core import usage | |
42 |
|
42 | |||
43 | #----------------------------------------------------------------------------- |
|
43 | #----------------------------------------------------------------------------- | |
@@ -635,6 +635,7 b' class IPythonApp(Application):' | |||||
635 | self.shell.showtraceback() |
|
635 | self.shell.showtraceback() | |
636 |
|
636 | |||
637 | def start_app(self): |
|
637 | def start_app(self): | |
|
638 | check_for_old_config(self.ipython_dir) | |||
638 | if self.master_config.Global.interact: |
|
639 | if self.master_config.Global.interact: | |
639 | self.log.debug("Starting IPython's mainloop...") |
|
640 | self.log.debug("Starting IPython's mainloop...") | |
640 | self.shell.mainloop() |
|
641 | self.shell.mainloop() |
@@ -18,6 +18,7 b' import os' | |||||
18 | import sys |
|
18 | import sys | |
19 |
|
19 | |||
20 | import IPython |
|
20 | import IPython | |
|
21 | from IPython.utils import warn | |||
21 | from IPython.utils.process import system |
|
22 | from IPython.utils.process import system | |
22 | from IPython.utils.importstring import import_item |
|
23 | from IPython.utils.importstring import import_item | |
23 |
|
24 | |||
@@ -399,3 +400,22 b' def target_update(target,deps,cmd):' | |||||
399 | if target_outdated(target,deps): |
|
400 | if target_outdated(target,deps): | |
400 | system(cmd) |
|
401 | system(cmd) | |
401 |
|
402 | |||
|
403 | def check_for_old_config(ipython_dir=None): | |||
|
404 | """Check for old config files, and present a warning if they exist. | |||
|
405 | ||||
|
406 | A link to the docs of the new config is included in the message. | |||
|
407 | ||||
|
408 | This should mitigate confusion with the transition to the new | |||
|
409 | config system in 0.11. | |||
|
410 | """ | |||
|
411 | if ipython_dir is None: | |||
|
412 | ipython_dir = get_ipython_dir() | |||
|
413 | ||||
|
414 | old_configs = ['ipy_user_conf.py', 'ipythonrc'] | |||
|
415 | for cfg in old_configs: | |||
|
416 | f = os.path.join(ipython_dir, cfg) | |||
|
417 | if os.path.exists(f): | |||
|
418 | warn.warn("""Found old IPython config file %r. | |||
|
419 | The IPython configuration system has changed as of 0.11, and this file will be ignored. | |||
|
420 | See http://ipython.github.com/ipython-doc/dev/config for details on the new config system. | |||
|
421 | The current default config file is 'ipython_config.py'"""%f) |
General Comments 0
You need to be logged in to leave comments.
Login now