diff --git a/IPython/Extensions/ipy_kitcfg.py b/IPython/Extensions/ipy_kitcfg.py index 3a7e9f3..ffd2dff 100644 --- a/IPython/Extensions/ipy_kitcfg.py +++ b/IPython/Extensions/ipy_kitcfg.py @@ -29,25 +29,49 @@ def exta_imports(): # note that this is never run, it's just here for py2exe import distutils.dir_util +def kitroot(): + return os.environ.get('IPYKITROOT', None) + def main(): - root = os.environ.get('IPYKITROOT', None) - if not root: + + if not kitroot(): print "Can't configure ipykit, IPYKITROOT should be set." return - - os.environ["PATH"] = os.environ["PATH"] + ";" + root + "\\bin;" + + os.environ["PATH"] = os.environ["PATH"] + ";" + kitroot() + "\\bin;" ip.to_user_ns("pylaunchers") + cmds = ip.db.get('syscmdlist', None) + if cmds is None: + ip.magic('rehashx') + cmds = ip.db.get('syscmdlist', []) + #print cmds + if 'sc1' in cmds: + print "Default editor: Sc1" + import ipy_editors + ipy_editors.scite('sc1') + # for icp, imv, imkdir, etc. + import ipy_fsops + +greeting = """\n\n === Welcome to ipykit === + +%quickref - learn quickly about IPython. + +""" def ipython_firstrun(ip): + print "First run of ipykit - configuring" + ip.defalias('py',selflaunch) - ip.defalias('d','ls -F') - ip.defalias('ls','ls') + ip.defalias('d','dir /w /og /on') ip.magic('store py') ip.magic('store d') - ip.magic('store ls') + + bins = kitroot() +'/bin' + print greeting + def init_ipython(ipy): global ip ip = ipy diff --git a/exesetup.py b/exesetup.py index 5fa16ae..1fa7cd6 100644 --- a/exesetup.py +++ b/exesetup.py @@ -68,7 +68,8 @@ setup(name = name, 'pyreadline'], 'excludes' : ["Tkconstants","Tkinter","tcl",'IPython.igrid','wx', 'wxPython','igrid', 'PyQt4', 'zope', 'Zope', 'Zope2', - '_curses','enthought.traits','gtk','qt'] + '_curses','enthought.traits','gtk','qt', 'pydb','idlelib', + ] } }, @@ -91,9 +92,9 @@ setup(name = name, minimal_conf = """ import IPython.ipapi ip = IPython.ipapi.get() -import ipy_profile_sh -ip.load('ipy_kitcfg') +ip.load('ipy_kitcfg') +import ipy_profile_sh """ if not os.path.isdir("dist/_ipython"): @@ -102,4 +103,4 @@ if not os.path.isdir("dist/_ipython"): open("dist/_ipython/ipythonrc.ini","w").write("# intentionally blank\n") open("dist/_ipython/ipy_user_conf.py","w").write(minimal_conf) if os.path.isdir('bin'): - dir_util.copy_tree('bin','dist/_ipython/bin') + dir_util.copy_tree('bin','dist/bin') diff --git a/tools/mkrel.py b/tools/mkrel.py index 7ad6ec8..4d3b056 100755 --- a/tools/mkrel.py +++ b/tools/mkrel.py @@ -9,23 +9,31 @@ requires py2exe import os import distutils.dir_util +import sys + +execfile('../IPython/Release.py') + def c(cmd): print ">",cmd os.system(cmd) +ipykit_name = "ipykit-%s" % version + + os.chdir('..') if os.path.isdir('dist'): distutils.dir_util.remove_tree('dist') -if os.path.isdir('ipykit'): - distutils.dir_util.remove_tree('ipykit') +if os.path.isdir(ipykit_name): + distutils.dir_util.remove_tree(ipykit_name) c("python exesetup.py py2exe") -os.rename('dist','ipykit') -c("zip -r ipykit.zip ipykit") +os.rename('dist',ipykit_name) + +c("zip -r %s.zip %s" % (ipykit_name, ipykit_name)) c("python setup.py bdist_wininst --install-script=ipython_win_post_install.py") os.chdir("dist") -c("svn export http://ipython.scipy.org/svn/ipython/ipython/trunk ipython") -c("zip -r ipython_svn.zip ipython") +#c("svn export http://ipython.scipy.org/svn/ipython/ipython/trunk ipython") +#c("zip -r ipython_svn.zip ipython")