##// END OF EJS Templates
Update copyright/author statements....
Update copyright/author statements. - Updated copyright statements to use the new form: # Copyright (C) 2008-2009 The IPython Development Team I left the old notices in place (just updating the year in some cases), because as far as I know, old copyright statements are not meant to be retroactively modified. - Also, on most files, replaced __author__ marks with an 'Authors' section in the module docstring. This reduces top-level code in the module, while ensuring that the Author(s) get properly acknowledged in auto-generated API docs (sphinx doesn't read __author__ marks, but it will include the module docstring). I only left a few in place for very old files that we ship externally, and for those by Laurent: he had his authorship mark both in the docstring and in __author__ variables, so I think out of courtesy it would be better to ask him about it on the list. All the others were I found regular __author__ variables, I moved them to the main docstring.

File last commit:

r861:22534c70
r1875:bba7e571
Show More
ipy_kitcfg.py
80 lines | 2.0 KiB | text/x-python | PythonLexer
vivainio
crlf normalization
r851 import os,sys
import ipy_rehashdir,glob
from ipy_rehashdir import selflaunch, PyLauncher
def pylaunchers():
"""Create launchers for python scripts in cwd and store them in alias table
This is useful if you want to invoke .py scripts from ipykit session,
just adding .py files in PATH does not work without file association.
.ipy files will be run like macros.
"""
vivainio
ipykit: PyLauncher first arg strip
r861 fs = glob.glob('*.py') + glob.glob('*.ipy')
vivainio
crlf normalization
r851 for f in fs:
l = PyLauncher(f)
n = os.path.splitext(f)[0]
ip.defalias(n, l)
ip.magic('store '+n)
def exta_imports():
# add some modules that you'd want to be bundled in the ipykit
# library zip file here. Do this if you get ImportErrors from scripts you
# try to launch with 'py' or pylaunchers. In theory you could include
# the whole stdlib here for full script coverage
# note that this is never run, it's just here for py2exe
import distutils.dir_util
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854 def kitroot():
return os.environ.get('IPYKITROOT', None)
vivainio
crlf normalization
r851 def main():
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854
if not kitroot():
vivainio
crlf normalization
r851 print "Can't configure ipykit, IPYKITROOT should be set."
return
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854
os.environ["PATH"] = os.environ["PATH"] + ";" + kitroot() + "\\bin;"
vivainio
crlf normalization
r851 ip.to_user_ns("pylaunchers")
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854 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')
vivainio
crlf normalization
r851
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854 # for icp, imv, imkdir, etc.
import ipy_fsops
greeting = """\n\n === Welcome to ipykit ===
%quickref - learn quickly about IPython.
"""
vivainio
crlf normalization
r851
def ipython_firstrun(ip):
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854
vivainio
crlf normalization
r851 print "First run of ipykit - configuring"
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854
vivainio
crlf normalization
r851 ip.defalias('py',selflaunch)
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854 ip.defalias('d','dir /w /og /on')
vivainio
crlf normalization
r851 ip.magic('store py')
ip.magic('store d')
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854
bins = kitroot() +'/bin'
vivainio
crlf normalization
r851
vivainio
ipykit improvements (built in Sc1 setup etc.)
r854 print greeting
vivainio
crlf normalization
r851 def init_ipython(ipy):
global ip
ip = ipy
main()