##// END OF EJS Templates
%upgrade -nolegacy
vivainio -
Show More
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Magic functions for InteractiveShell.
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 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
@@ -2823,19 +2823,26 b' Defaulting color scheme to \'NoColor\'"""'
2823 This will copy the config files that don't yet exist in your
2823 This will copy the config files that don't yet exist in your
2824 ipython dir from the system config dir. Use this after upgrading
2824 ipython dir from the system config dir. Use this after upgrading
2825 IPython if you don't wish to delete your .ipython dir.
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 ip = self.getapi()
2831 ip = self.getapi()
2829 ipinstallation = path(IPython.__file__).dirname()
2832 ipinstallation = path(IPython.__file__).dirname()
2830 upgrade_script = ipinstallation / 'upgrade_dir.py'
2833 upgrade_script = ipinstallation / 'upgrade_dir.py'
2831 src_config = ipinstallation / 'UserConfig'
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 print ">",cmd
2837 print ">",cmd
2834 shell(cmd)
2838 shell(cmd)
2835
2839 if arg == '-nolegacy':
2836
2840 legacy = userdir.files('ipythonrc*')
2837
2841 print "Nuking legacy files:",legacy
2838
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 # end Magic
2848 # end Magic
@@ -19,6 +19,9 b' you can do here.'
19 import IPython.ipapi
19 import IPython.ipapi
20 ip = IPython.ipapi.get()
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 def main():
25 def main():
23 o = ip.options()
26 o = ip.options()
24 # An example on how to set options
27 # An example on how to set options
General Comments 0
You need to be logged in to leave comments. Login now