Show More
@@ -4,6 +4,12 b'' | |||
|
4 | 4 | import os, sys, shutil |
|
5 | 5 | pjoin = os.path.join |
|
6 | 6 | |
|
7 | # import setuptools if we can | |
|
8 | try: | |
|
9 | import setuptools | |
|
10 | except ImportError: | |
|
11 | pass | |
|
12 | ||
|
7 | 13 | def mkshortcut(target,description,link_file,*args,**kw): |
|
8 | 14 | """make a shortcut if it doesn't exist, and register its creation""" |
|
9 | 15 | |
@@ -18,6 +24,13 b' def install():' | |||
|
18 | 24 | # Get some system constants |
|
19 | 25 | prefix = sys.prefix |
|
20 | 26 | python = pjoin(prefix, 'python.exe') |
|
27 | pythonw = pjoin(prefix, 'pythonw.exe') | |
|
28 | have_setuptools = 'setuptools' in sys.modules | |
|
29 | ||
|
30 | if not have_setuptools: | |
|
31 | # This currently doesn't work without setuptools, | |
|
32 | # so don't bother making broken links | |
|
33 | return | |
|
21 | 34 | |
|
22 | 35 | # Lookup path to common startmenu ... |
|
23 | 36 | ip_start_menu = pjoin(get_special_folder_path('CSIDL_COMMON_PROGRAMS'), 'IPython') |
@@ -38,6 +51,8 b' def install():' | |||
|
38 | 51 | 'irunner' |
|
39 | 52 | ] |
|
40 | 53 | scripts = pjoin(prefix,'scripts') |
|
54 | if not have_setuptools: | |
|
55 | # only create .bat files if we don't have setuptools | |
|
41 | 56 | for program in programs: |
|
42 | 57 | raw = pjoin(scripts, program) |
|
43 | 58 | bat = raw + '.bat' |
@@ -51,7 +66,7 b' def install():' | |||
|
51 | 66 | |
|
52 | 67 | # Now move onto setting the Start Menu up |
|
53 | 68 | ipybase = pjoin(scripts, 'ipython') |
|
54 |
if |
|
|
69 | if have_setuptools: | |
|
55 | 70 | # let setuptools take care of the scripts: |
|
56 | 71 | ipybase = ipybase + '-script.py' |
|
57 | 72 | workdir = "%HOMEDRIVE%%HOMEPATH%" |
@@ -61,21 +76,33 b' def install():' | |||
|
61 | 76 | mkshortcut(python, 'IPython', link, cmd, workdir) |
|
62 | 77 | |
|
63 | 78 | link = pjoin(ip_start_menu, 'pysh.lnk') |
|
64 |
cmd = '"%s" |
|
|
79 | cmd = '"%s" profile=pysh --init' % ipybase | |
|
65 | 80 | mkshortcut(python, 'IPython (command prompt mode)', link, cmd, workdir) |
|
66 | 81 | |
|
67 |
link = pjoin(ip_start_menu, ' |
|
|
68 |
cmd = '"%s" |
|
|
69 |
mkshortcut(python, 'IPython ( |
|
|
82 | link = pjoin(ip_start_menu, 'pylab.lnk') | |
|
83 | cmd = '"%s" profile=pylab --init' % ipybase | |
|
84 | mkshortcut(python, 'IPython (pylab profile)', link, cmd, workdir) | |
|
70 | 85 | |
|
71 | 86 | link = pjoin(ip_start_menu, 'ipcontroller.lnk') |
|
72 |
cmd = |
|
|
87 | cmdbase = pjoin(scripts, 'ipcontroller') | |
|
88 | if have_setuptools: | |
|
89 | cmdbase += '-script.py' | |
|
90 | cmd = '"%s"' % cmdbase | |
|
73 | 91 | mkshortcut(python, 'IPython controller', link, cmd, workdir) |
|
74 | 92 | |
|
75 | 93 | link = pjoin(ip_start_menu, 'ipengine.lnk') |
|
76 |
cmd = |
|
|
94 | cmdbase = pjoin(scripts, 'ipengine') | |
|
95 | if have_setuptools: | |
|
96 | cmdbase += '-script.py' | |
|
97 | cmd = '"%s"' % cmdbase | |
|
77 | 98 | mkshortcut(python, 'IPython engine', link, cmd, workdir) |
|
78 | 99 | |
|
100 | link = pjoin(ip_start_menu, 'ipythonqt.lnk') | |
|
101 | cmdbase = pjoin(scripts, 'ipython-qtconsole') | |
|
102 | if have_setuptools: | |
|
103 | cmdbase += '-script.pyw' | |
|
104 | cmd = '"%s"' % cmdbase | |
|
105 | mkshortcut(pythonw, 'IPython Qt Console', link, cmd, workdir) | |
|
79 | 106 | # Create documentation shortcuts ... |
|
80 | 107 | t = prefix + r'\share\doc\ipython\manual\ipython.pdf' |
|
81 | 108 | f = ip_start_menu + r'\Manual in PDF.lnk' |
General Comments 0
You need to be logged in to leave comments.
Login now