#!python """Windows-specific part of the installation""" import os, sys try: import ctypes except ImportError: print 'To use the complete range and power of IPython functionality you\ should get ctypes from http://sourceforge.net/projects/ctypes' try: import readline except ImportError: print 'To use the complete range and power of IPython functionality you\ should get ctypes from http://sourceforge.net/projects/uncpythontools' def install(): # Lookup path to common startmenu ... d = get_special_folder_path('CSIDL_COMMON_PROGRAMS') d = d + '\\IPython' # Create IPython entry ... if not os.path.isdir(d): os.mkdir(d) directory_created(d) os.chdir(d) # Create program shortcuts ... python = sys.prefix + '\\python.exe' f = d + '\\IPython.lnk' a = sys.prefix + '\\scripts\ipython.py' if not os.path.isfile(f): create_shortcut(python, 'IPython', f, a) file_created(f) f = d + '\\pysh.lnk' a = sys.prefix + '\\scripts\ipython.py -p pysh' if not os.path.isfile(f): create_shortcut(python, 'pysh', f, a) file_created(f) # Create documentation shortcuts ... from IPython.Release import version man_pdf = sys.prefix + '\\share\\doc\\ipython-%s\\manual.pdf' % version f = d + '\\Manual in PDF.lnk' if not os.path.isfile(f): create_shortcut(man_pdf, 'IPython Manual - PDF-Format', f) file_created(f) man_html = sys.prefix + '\\share\\doc\\ipython-%s\\manual\\manual.html' % version f = d + '\\Manual in HTML.lnk' if not os.path.isfile(f): create_shortcut(man_html, 'IPython Manual - HTML-Format', f) file_created(f) def remove(): pass 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]