Source
ipshell = IPython.Shell.IPShell( argv=['-prompt_in1','CASA <\#>: ','-autocall','2','-colors',__ipython_colors, '-nomessages', '-nobanner','-logfile',ipythonlog,'-upgrade','-ipythondir',casa['dirs']['rc']+'/ipython','-c','execfile("'+casa['flags']['-c']+'")'], user_ns=globals() )
import os
if os.environ.has_key('LD_PRELOAD'):
del os.environ['LD_PRELOAD']
import sys
import time
import signal
import filecmp
import traceback # To pretty-print tracebacks
from subprocess import Popen, PIPE, STDOUT
##
## toplevel frame marker
##
_casa_top_frame_ = True
# jagonzal: MPIServer initialization before watchdog fork
from mpi4casa.MPIEnvironment import MPIEnvironment
if MPIEnvironment.is_mpi_enabled and not MPIEnvironment.is_mpi_client:
import mpi4casa.mpi4casapy as mpi4casapy
mpi4casapy.run()
exit()
##
## tweak path... where necessary...
##
## path_addition = [ ]
## for p in sys.path :
## if p.startswith(sys.prefix):
## # According to
## # http://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html
## # "Python modules not handled by python-central or python-support must
## # be installed in the system Python modules directory,
## # /usr/lib/pythonX.Y/dist-packages for python2.6 and later, and
## # /usr/lib/pythonX.Y/site-packages for python2.5 and earlier."
## #
## # I am not sure if this is general Python policy, or just Debian policy.
## # In any case, dist-packages is a more honestly named site-packages, since
## # nominally site stuff goes in /usr/local or /opt.
## #
## for wanted in ['lib-tk', 'dist-packages']:
## newpath = p + os.sep + wanted
## if os.path.isdir(newpath):
## path_addition.append(newpath)
#sys.path = sys.path + path_addition
# i.e. /usr/lib/pymodules/python2.6, needed for matplotlib in Debian and its derivatives.
#pymodules_dir = sys.prefix + '/lib/pymodules/python' + '.'.join(map(str, sys.version_info[:2]))
#if os.path.isdir(pymodules_dir) and pymodules_dir not in sys.path:
# sys.path.append(pymodules_dir)
##
## ensure that we're the process group leader
## of all processes that we fork...
##
try:
os.setpgid(0,0)
except OSError, e:
print "setgpid( ) failed: " + e.strerror
print " processes may be left dangling..."