##// END OF EJS Templates
_ip.runlines() is now much more liberal about indentation - it cleans up the scripts it gets
_ip.runlines() is now much more liberal about indentation - it cleans up the scripts it gets

File last commit:

r771:049a09a3
r987:9c4e4577
Show More
ipython_win_post_install.py
85 lines | 2.6 KiB | text/x-python | PythonLexer
/ scripts / ipython_win_post_install.py
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0 #!python
"""Windows-specific part of the installation"""
vivainio
merge all from 0.7.3 branch to trunk
r503 import os, sys, shutil
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0
vivainio
merge all from 0.7.3 branch to trunk
r503 def mkshortcut(target,description,link_file,*args,**kw):
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0 """make a shortcut if it doesn't exist, and register its creation"""
vivainio
merge all from 0.7.3 branch to trunk
r503 create_shortcut(target, description, link_file,*args,**kw)
file_created(link_file)
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0
def install():
"""Routine to be run by the win32 installer with the -install switch."""
from IPython.Release import version
# Get some system constants
prefix = sys.prefix
python = prefix + r'\python.exe'
# Lookup path to common startmenu ...
ip_dir = get_special_folder_path('CSIDL_COMMON_PROGRAMS') + r'\IPython'
# Some usability warnings at installation time. I don't want them at the
# top-level, so they don't appear if the user is uninstalling.
try:
import ctypes
except ImportError:
print ('To take full advantage of IPython, you need ctypes from:\n'
'http://sourceforge.net/projects/ctypes')
try:
import win32con
except ImportError:
print ('To take full advantage of IPython, you need pywin32 from:\n'
'http://starship.python.net/crew/mhammond/win32/Downloads.html')
try:
import readline
except ImportError:
print ('To take full advantage of IPython, you need readline from:\n'
'http://sourceforge.net/projects/uncpythontools')
vivainio
Apply Ryan Krauss patch for fixing start menu shortcuts if there are spaces in ipython installation dir name
r771 ipybase = '"'+prefix+r'\scripts\ipython"'
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0 # Create IPython entry ...
if not os.path.isdir(ip_dir):
os.mkdir(ip_dir)
directory_created(ip_dir)
# Create program shortcuts ...
f = ip_dir + r'\IPython.lnk'
vivainio
Apply Ryan Krauss patch for fixing start menu shortcuts if there are spaces in ipython installation dir name
r771 a = ipybase
vivainio
merge all from 0.7.3 branch to trunk
r503 mkshortcut(python,'IPython',f,a)
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0
f = ip_dir + r'\pysh.lnk'
vivainio
Apply Ryan Krauss patch for fixing start menu shortcuts if there are spaces in ipython installation dir name
r771 a = ipybase+' -p sh'
vivainio
merge all from 0.7.3 branch to trunk
r503 mkshortcut(python,'IPython command prompt mode',f,a)
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0
vivainio
add scipy to start menu
r639 f = ip_dir + r'\scipy.lnk'
vivainio
Apply Ryan Krauss patch for fixing start menu shortcuts if there are spaces in ipython installation dir name
r771 a = ipybase+' -pylab -p scipy'
vivainio
add scipy to start menu
r639 mkshortcut(python,'IPython scipy profile',f,a)
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0 # Create documentation shortcuts ...
t = prefix + r'\share\doc\ipython-%s\manual.pdf' % version
f = ip_dir + r'\Manual in PDF.lnk'
vivainio
merge all from 0.7.3 branch to trunk
r503 mkshortcut(t,r'IPython Manual - PDF-Format',f)
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0
t = prefix + r'\share\doc\ipython-%s\manual\manual.html' % version
f = ip_dir + r'\Manual in HTML.lnk'
vivainio
merge all from 0.7.3 branch to trunk
r503 mkshortcut(t,'IPython Manual - HTML-Format',f)
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0
vivainio
merge all from 0.7.3 branch to trunk
r503 # make ipython.py
shutil.copy(prefix + r'\scripts\ipython', prefix + r'\scripts\ipython.py')
fperez
Reorganized the directory for ipython/ to have its own dir, which is a bit...
r0 def remove():
"""Routine to be run by the win32 installer with the -remove switch."""
pass
# main()
if len(sys.argv) > 1:
if sys.argv[1] == '-install':
install()
elif sys.argv[1] == '-remove':
remove()
else:
print "Script was called with option %s" % sys.argv[1]