Show More
@@ -1,7 +1,7 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """Magic functions for InteractiveShell. |
|
3 | 3 | |
|
4 |
$Id: Magic.py 117 |
|
|
4 | $Id: Magic.py 1179 2006-02-24 18:32:09Z vivainio $""" | |
|
5 | 5 | |
|
6 | 6 | #***************************************************************************** |
|
7 | 7 | # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and |
@@ -2823,19 +2823,26 b' Defaulting color scheme to \'NoColor\'"""' | |||
|
2823 | 2823 | This will copy the config files that don't yet exist in your |
|
2824 | 2824 | ipython dir from the system config dir. Use this after upgrading |
|
2825 | 2825 | IPython if you don't wish to delete your .ipython dir. |
|
2826 | ||
|
2826 | ||
|
2827 | Call with -nolegacy to get rid of ipythonrc* files (recommended for | |
|
2828 | new users) | |
|
2829 | ||
|
2827 | 2830 | """ |
|
2828 | 2831 | ip = self.getapi() |
|
2829 | 2832 | ipinstallation = path(IPython.__file__).dirname() |
|
2830 | 2833 | upgrade_script = ipinstallation / 'upgrade_dir.py' |
|
2831 | 2834 | src_config = ipinstallation / 'UserConfig' |
|
2832 |
|
|
|
2835 | userdir = path(ip.options().ipythondir) | |
|
2836 | cmd = upgrade_script + " " + src_config + " " + userdir | |
|
2833 | 2837 | print ">",cmd |
|
2834 | 2838 | shell(cmd) |
|
2835 | ||
|
2836 | ||
|
2837 | ||
|
2838 | ||
|
2839 | if arg == '-nolegacy': | |
|
2840 | legacy = userdir.files('ipythonrc*') | |
|
2841 | print "Nuking legacy files:",legacy | |
|
2842 | ||
|
2843 | [p.remove() for p in legacy] | |
|
2844 | suffix = (sys.platform == 'win32' and '.ini' or '') | |
|
2845 | (userdir / ('ipythonrc' + suffix)).write_text('# Empty, see ipy_user_conf.py\n') | |
|
2839 | 2846 | |
|
2840 | 2847 | |
|
2841 | 2848 | # end Magic |
General Comments 0
You need to be logged in to leave comments.
Login now