Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Warn on old config files #414

Closed
wants to merge 2 commits into from

2 participants

@minrk
Owner

add check_for_old_config() to utils.path, which warns users about old config files, and point them to new ones. Launching IPython will continue to raise the warning until you update your config files.

Should address #304.

Are there other config files I should check for besides 'ipy_user_conf.py' and 'ipythonrc'?

@takluyver
Owner

Is it worth adding some way to suppress the message without removing the config files? If users are running both 0.10 and 0.11 (e.g. to port their parallel code to the new architecture), it could get annoying.

Also, an equivalent warning in the Qt console might be helpful, although I guess there's less expectation that the old config would affect that.

@minrk minrk add ignore_old_config configurable
for users who still use multiple versions of IPython
4564a29
@minrk
Owner

Sure, I added the configurable to suppress the warnings.

The Qt Console doesn't use any configuration at all (see #175), but once it does the warning will be added to its Application.

@takluyver
Owner

OK, thanks. This looks good to me.

@minrk minrk closed this pull request from a commit
@minrk minrk add ignore_old_config configurable
for users who still use multiple versions of IPython

closes gh-414
3273c8c
@minrk minrk closed this in 3273c8c
@ellisonbg ellisonbg referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@damianavila damianavila referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@dpsanders dpsanders referenced this pull request from a commit in minrk/ipython
@minrk minrk update nbconvert doc
update to new CLI

remove documentation of ill-advised `--script` option.
be3998a
@mattvonrocketstein mattvonrocketstein referenced this pull request from a commit in mattvonrocketstein/ipython
@minrk minrk add ignore_old_config configurable
for users who still use multiple versions of IPython

closes gh-414
e71d699
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 4, 2011
  1. @minrk
Commits on May 5, 2011
  1. @minrk

    add ignore_old_config configurable

    minrk authored
    for users who still use multiple versions of IPython
This page is out of date. Refresh to see the latest.
View
4 IPython/config/default/ipython_config.py
@@ -11,6 +11,10 @@
# c.Global.nosep = True
+# If you still use multiple versions of IPytho on the same machine,
+# set this to True to suppress warnings about old configuration files
+# c.Global.ignore_old_config = False
+
# Set this to determine the detail of what is logged at startup.
# The default is 30 and possible values are 0,10,20,30,40,50.
# c.Global.log_level = 20
View
4 IPython/frontend/terminal/ipapp.py
@@ -37,7 +37,7 @@
PyFileConfigLoader
)
from IPython.lib import inputhook
-from IPython.utils.path import filefind, get_ipython_dir
+from IPython.utils.path import filefind, get_ipython_dir, check_for_old_config
from IPython.core import usage
#-----------------------------------------------------------------------------
@@ -635,6 +635,8 @@ def _run_cmd_line_code(self):
self.shell.showtraceback()
def start_app(self):
+ if not getattr(self.master_config.Global, 'ignore_old_config', False):
+ check_for_old_config(self.ipython_dir)
if self.master_config.Global.interact:
self.log.debug("Starting IPython's mainloop...")
self.shell.mainloop()
View
22 IPython/utils/path.py
@@ -18,6 +18,7 @@
import sys
import IPython
+from IPython.utils import warn
from IPython.utils.process import system
from IPython.utils.importstring import import_item
@@ -399,3 +400,24 @@ def target_update(target,deps,cmd):
if target_outdated(target,deps):
system(cmd)
+def check_for_old_config(ipython_dir=None):
+ """Check for old config files, and present a warning if they exist.
+
+ A link to the docs of the new config is included in the message.
+
+ This should mitigate confusion with the transition to the new
+ config system in 0.11.
+ """
+ if ipython_dir is None:
+ ipython_dir = get_ipython_dir()
+
+ old_configs = ['ipy_user_conf.py', 'ipythonrc']
+ for cfg in old_configs:
+ f = os.path.join(ipython_dir, cfg)
+ if os.path.exists(f):
+ warn.warn("""Found old IPython config file %r.
+ The IPython configuration system has changed as of 0.11, and this file will be ignored.
+ See http://ipython.github.com/ipython-doc/dev/config for details on the new config system.
+ The current default config file is 'ipython_config.py', where you can suppress these
+ warnings with `Global.ignore_old_config = True`."""%f)
+
Something went wrong with that request. Please try again.