##// END OF EJS Templates
%upgrade -nolegacy
vivainio -
Show More
@@ -1,7 +1,7 b''
1 1 # -*- coding: utf-8 -*-
2 2 """Magic functions for InteractiveShell.
3 3
4 $Id: Magic.py 1178 2006-02-24 17:26:36Z vivainio $"""
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
@@ -2824,18 +2824,25 b' Defaulting color scheme to \'NoColor\'"""'
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 cmd = upgrade_script + " " + src_config + " " + ip.options().ipythondir
2835 userdir = path(ip.options().ipythondir)
2836 cmd = upgrade_script + " " + src_config + " " + userdir
2833 2837 print ">",cmd
2834 2838 shell(cmd)
2839 if arg == '-nolegacy':
2840 legacy = userdir.files('ipythonrc*')
2841 print "Nuking legacy files:",legacy
2835 2842
2836
2837
2838
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
@@ -19,6 +19,9 b' you can do here.'
19 19 import IPython.ipapi
20 20 ip = IPython.ipapi.get()
21 21
22 # You probably want to uncomment this if you did %upgrade -nolegacy
23 # import ipy_sane_defaults
24
22 25 def main():
23 26 o = ip.options()
24 27 # An example on how to set options
General Comments 0
You need to be logged in to leave comments. Login now