##// END OF EJS Templates
Apply Ryan Krauss patch for fixing start menu shortcuts if there are spaces in ipython installation dir name
vivainio -
Show More
@@ -1,84 +1,85 b''
1 #!python
1 #!python
2 """Windows-specific part of the installation"""
2 """Windows-specific part of the installation"""
3
3
4 import os, sys, shutil
4 import os, sys, shutil
5
5
6 def mkshortcut(target,description,link_file,*args,**kw):
6 def mkshortcut(target,description,link_file,*args,**kw):
7 """make a shortcut if it doesn't exist, and register its creation"""
7 """make a shortcut if it doesn't exist, and register its creation"""
8
8
9 create_shortcut(target, description, link_file,*args,**kw)
9 create_shortcut(target, description, link_file,*args,**kw)
10 file_created(link_file)
10 file_created(link_file)
11
11
12 def install():
12 def install():
13 """Routine to be run by the win32 installer with the -install switch."""
13 """Routine to be run by the win32 installer with the -install switch."""
14
14
15 from IPython.Release import version
15 from IPython.Release import version
16
16
17 # Get some system constants
17 # Get some system constants
18 prefix = sys.prefix
18 prefix = sys.prefix
19 python = prefix + r'\python.exe'
19 python = prefix + r'\python.exe'
20 # Lookup path to common startmenu ...
20 # Lookup path to common startmenu ...
21 ip_dir = get_special_folder_path('CSIDL_COMMON_PROGRAMS') + r'\IPython'
21 ip_dir = get_special_folder_path('CSIDL_COMMON_PROGRAMS') + r'\IPython'
22
22
23 # Some usability warnings at installation time. I don't want them at the
23 # Some usability warnings at installation time. I don't want them at the
24 # top-level, so they don't appear if the user is uninstalling.
24 # top-level, so they don't appear if the user is uninstalling.
25 try:
25 try:
26 import ctypes
26 import ctypes
27 except ImportError:
27 except ImportError:
28 print ('To take full advantage of IPython, you need ctypes from:\n'
28 print ('To take full advantage of IPython, you need ctypes from:\n'
29 'http://sourceforge.net/projects/ctypes')
29 'http://sourceforge.net/projects/ctypes')
30
30
31 try:
31 try:
32 import win32con
32 import win32con
33 except ImportError:
33 except ImportError:
34 print ('To take full advantage of IPython, you need pywin32 from:\n'
34 print ('To take full advantage of IPython, you need pywin32 from:\n'
35 'http://starship.python.net/crew/mhammond/win32/Downloads.html')
35 'http://starship.python.net/crew/mhammond/win32/Downloads.html')
36
36
37 try:
37 try:
38 import readline
38 import readline
39 except ImportError:
39 except ImportError:
40 print ('To take full advantage of IPython, you need readline from:\n'
40 print ('To take full advantage of IPython, you need readline from:\n'
41 'http://sourceforge.net/projects/uncpythontools')
41 'http://sourceforge.net/projects/uncpythontools')
42
42
43 ipybase = '"'+prefix+r'\scripts\ipython"'
43 # Create IPython entry ...
44 # Create IPython entry ...
44 if not os.path.isdir(ip_dir):
45 if not os.path.isdir(ip_dir):
45 os.mkdir(ip_dir)
46 os.mkdir(ip_dir)
46 directory_created(ip_dir)
47 directory_created(ip_dir)
47
48
48 # Create program shortcuts ...
49 # Create program shortcuts ...
49 f = ip_dir + r'\IPython.lnk'
50 f = ip_dir + r'\IPython.lnk'
50 a = prefix + r'\scripts\ipython'
51 a = ipybase
51 mkshortcut(python,'IPython',f,a)
52 mkshortcut(python,'IPython',f,a)
52
53
53 f = ip_dir + r'\pysh.lnk'
54 f = ip_dir + r'\pysh.lnk'
54 a = prefix + r'\scripts\ipython -p sh'
55 a = ipybase+' -p sh'
55 mkshortcut(python,'IPython command prompt mode',f,a)
56 mkshortcut(python,'IPython command prompt mode',f,a)
56
57
57 f = ip_dir + r'\scipy.lnk'
58 f = ip_dir + r'\scipy.lnk'
58 a = prefix + r'\scripts\ipython -pylab -p scipy'
59 a = ipybase+' -pylab -p scipy'
59 mkshortcut(python,'IPython scipy profile',f,a)
60 mkshortcut(python,'IPython scipy profile',f,a)
60
61
61 # Create documentation shortcuts ...
62 # Create documentation shortcuts ...
62 t = prefix + r'\share\doc\ipython-%s\manual.pdf' % version
63 t = prefix + r'\share\doc\ipython-%s\manual.pdf' % version
63 f = ip_dir + r'\Manual in PDF.lnk'
64 f = ip_dir + r'\Manual in PDF.lnk'
64 mkshortcut(t,r'IPython Manual - PDF-Format',f)
65 mkshortcut(t,r'IPython Manual - PDF-Format',f)
65
66
66 t = prefix + r'\share\doc\ipython-%s\manual\manual.html' % version
67 t = prefix + r'\share\doc\ipython-%s\manual\manual.html' % version
67 f = ip_dir + r'\Manual in HTML.lnk'
68 f = ip_dir + r'\Manual in HTML.lnk'
68 mkshortcut(t,'IPython Manual - HTML-Format',f)
69 mkshortcut(t,'IPython Manual - HTML-Format',f)
69
70
70 # make ipython.py
71 # make ipython.py
71 shutil.copy(prefix + r'\scripts\ipython', prefix + r'\scripts\ipython.py')
72 shutil.copy(prefix + r'\scripts\ipython', prefix + r'\scripts\ipython.py')
72
73
73 def remove():
74 def remove():
74 """Routine to be run by the win32 installer with the -remove switch."""
75 """Routine to be run by the win32 installer with the -remove switch."""
75 pass
76 pass
76
77
77 # main()
78 # main()
78 if len(sys.argv) > 1:
79 if len(sys.argv) > 1:
79 if sys.argv[1] == '-install':
80 if sys.argv[1] == '-install':
80 install()
81 install()
81 elif sys.argv[1] == '-remove':
82 elif sys.argv[1] == '-remove':
82 remove()
83 remove()
83 else:
84 else:
84 print "Script was called with option %s" % sys.argv[1]
85 print "Script was called with option %s" % sys.argv[1]
@@ -1,29 +1,31 b''
1 """ Create ipykit and exe installer
1 """ Create ipykit and exe installer
2
2
3 requires py2exe
3 requires py2exe
4
4
5 """
5 """
6 #!/bin/sh
6 #!/bin/sh
7 # IPython release script
7 # IPython release script
8
8
9
9
10 import os
10 import os
11 import distutils.dir_util
11 import distutils.dir_util
12 def c(cmd):
12 def c(cmd):
13 print ">",cmd
13 print ">",cmd
14 os.system(cmd)
14 os.system(cmd)
15
15
16 os.chdir('..')
16 os.chdir('..')
17 distutils.dir_util.remove_tree('dist')
17 if os.path.isdir('dist'):
18 distutils.dir_util.remove_tree('ipykit')
18 distutils.dir_util.remove_tree('dist')
19 if os.path.isdir('ipykit'):
20 distutils.dir_util.remove_tree('ipykit')
19
21
20 c("python exesetup.py py2exe")
22 c("python exesetup.py py2exe")
21 os.rename('dist','ipykit')
23 os.rename('dist','ipykit')
22
24
23 c("zip -r ipykit.zip ipykit")
25 c("zip -r ipykit.zip ipykit")
24
26
25 c("python setup.py bdist_wininst --install-script=ipython_win_post_install.py")
27 c("python setup.py bdist_wininst --install-script=ipython_win_post_install.py")
26
28
27 os.chdir("dist")
29 os.chdir("dist")
28 c("svn export http://ipython.scipy.org/svn/ipython/ipython/trunk ipython")
30 c("svn export http://ipython.scipy.org/svn/ipython/ipython/trunk ipython")
29 c("zip -r ipython_svn.zip ipython")
31 c("zip -r ipython_svn.zip ipython")
General Comments 0
You need to be logged in to leave comments. Login now