diff --git a/IPython/Extensions/ipy_kitcfg.py b/IPython/Extensions/ipy_kitcfg.py new file mode 100644 index 0000000..2c135fc --- /dev/null +++ b/IPython/Extensions/ipy_kitcfg.py @@ -0,0 +1,16 @@ +#import IPython.ipapi +#ip = IPython.ipapi.get() + +import os + +def main(): + root = os.environ.get('IPYKITROOT', None) + if not root: + print "Can't configure ipykit, IPYKITROOT should be set." + return + + os.environ["PATH"] = os.environ["PATH"] + ";" + root + "\\bin;" + +main() + + diff --git a/IPython/genutils.py b/IPython/genutils.py index 8cc5ef0..64ccca9 100644 --- a/IPython/genutils.py +++ b/IPython/genutils.py @@ -5,7 +5,7 @@ General purpose utilities. This is a grab-bag of stuff I find useful in most programs I write. Some of these things are also convenient when working at the command line. -$Id: genutils.py 2398 2007-05-26 10:20:14Z vivainio $""" +$Id: genutils.py 2408 2007-05-28 16:29:50Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez. @@ -812,9 +812,11 @@ def get_home_dir(): # first, check py2exe distribution root directory for _ipython. # This overrides all. Normally does not exist. + if '\\library.zip\\' in IPython.__file__.lower(): root, rest = IPython.__file__.lower().split('library.zip') - if os.path.isdir(root + '_ipython'): + if isdir(root + '_ipython'): + os.environ["IPYKITROOT"] = root.rstrip('\\') return root try: diff --git a/exesetup.py b/exesetup.py index dee3dca..a940924 100644 --- a/exesetup.py +++ b/exesetup.py @@ -15,12 +15,6 @@ svn co http://ipython.scipy.org/svn/ipython/pyreadline/trunk/pyreadline - Create the distribution in 'dist' by running "python exesetup.py py2exe" -- Create initial configuration by running: - -mkdir dist\_ipython -touch dist/_ipython/ipythonrc.ini -echo import ipy_profile_sh > dist/_ipython/ipy_user_conf.py - - Run ipython.exe to go. """ @@ -63,20 +57,7 @@ def file_doesnt_endwith(test,endings): return True -if 'setuptools' in sys.modules: - # setuptools config for egg building - egg_extra_kwds = { - 'entry_points': { - 'console_scripts': [ - 'ipython = IPython.ipapi:launch_new_instance', - 'pycolor = IPython.PyColorize:main' - ]} - } - scriptfiles = [] - # eggs will lack docs, examples XXX not anymore - #datafiles = [('lib', 'IPython/UserConfig', cfgfiles)] -else: - egg_extra_kwds = {} +egg_extra_kwds = {} # Call the setup() routine which does most of the work setup(name = name, @@ -103,5 +84,8 @@ setup(name = name, **egg_extra_kwds ) - - +if not os.path.isdir("dist/_ipython"): + print "Creating simple _ipython dir" + os.mkdir("dist/_ipython") + open("dist/_ipython/ipythonrc.ini","w").write("# intentionally blank\n") + open("dist/_ipython/ipy_user_conf.py","w").write("import ipy_kitcfg\nimport ipy_profile_sh\n")