3
import ipy_rehashdir,glob
4
from ipy_rehashdir import selflaunch, PyLauncher
7
"""Create launchers for python scripts in cwd and store them in alias table
9
This is useful if you want to invoke .py scripts from ipykit session,
10
just adding .py files in PATH does not work without file association.
12
.ipy files will be run like macros.
15
fs = glob.glob('*.py') + glob.glob('*.ipy')
18
n = os.path.splitext(f)[0]
24
# add some modules that you'd want to be bundled in the ipykit
25
# library zip file here. Do this if you get ImportErrors from scripts you
26
# try to launch with 'py' or pylaunchers. In theory you could include
27
# the whole stdlib here for full script coverage
29
# note that this is never run, it's just here for py2exe
30
import distutils.dir_util
33
return os.environ.get('IPYKITROOT', None)
38
print "Can't configure ipykit, IPYKITROOT should be set."
41
os.environ["PATH"] = os.environ["PATH"] + ";" + kitroot() + "\\bin;"
42
ip.to_user_ns("pylaunchers")
43
cmds = ip.db.get('syscmdlist', None)
46
cmds = ip.db.get('syscmdlist', [])
49
print "Default editor: Sc1"
51
ipy_editors.scite('sc1')
53
# for icp, imv, imkdir, etc.
56
greeting = """\n\n === Welcome to ipykit ===
58
%quickref - learn quickly about IPython.
62
def ipython_firstrun(ip):
64
print "First run of ipykit - configuring"
66
ip.defalias('py',selflaunch)
67
ip.defalias('d','dir /w /og /on')
71
bins = kitroot() +'/bin'
75
def init_ipython(ipy):