Beispiel #1
0
    __configs.TerminalInteractiveShell.banner2 = ''
    __configs.HistoryManager.hist_file = __configs.TerminalInteractiveShell.ipython_dir + "/history.sqlite"
    __configs.TerminalIPythonApp.matplotlib = __defaults.backend

    ### what does this do?
    ###   (1) exec each of the startup files
    ###   (2) invoke matplotlib (for interactive grapics)
    ###       unless --agg flag has been supplied
    start_ipython(
        config=__configs,
        argv=(['--logfile=' +
               casa['files']['iplogfile']] if __defaults.ipython_log else []) +
        [
            '--ipython-dir=' + __defaults.rcdir + "/ipython", '--autocall=2',
            "-c", "for i in " + str(__startup_scripts) + ": execfile( i )" +
            ("\n%matplotlib" if __defaults.backend is not None else ""), "-i"
        ])

except:
    _exit_status = 1
    print "Unexpected error:"
    traceback.print_exc(file=sys.stdout)
    pass

### this should (perhaps) be placed in an 'atexit' hook...
for handler in casa_shutdown_handlers:
    handler()

from init_welcome_helpers import immediate_exit_with_handlers
immediate_exit_with_handlers(_exit_status)
Beispiel #2
0
    if len(__candidates) > 0:
        # Run file with filename given in the command line
        try:
            with redirect_argv(casa['flags'].execute):
                execfile(__candidates[0])

        except NameError, err:
            if str(err) == "name 'T' is not defined" or \
               str(err) == "name 'F' is not defined" or \
               str(err) == "name 'true' is not defined" or \
               str(err) == "name 'false' is not defined" :
                print "------------------------------------------------------------------------------"
                print "Warning: CASA no longer defines T/true and F/false as synonyms for True/False"
                print "------------------------------------------------------------------------------"
                traceback.print_exc()
                immediate_exit_with_handlers(1)

        except Exception, err:
            traceback.print_exc()
            immediate_exit_with_handlers(1)

        immediate_exit_with_handlers()

    else:
        try:
            exec(casa['flags'].execute[0])
        except Exception, err:
            traceback.print_exc()
            os._exit(0)

        immediate_exit_with_handlers()
Beispiel #3
0
               str(err) == "name 'true' is not defined" or \
               str(err) == "name 'false' is not defined" :
                print "------------------------------------------------------------------------------"
                print "Warning: CASA no longer defines T/true and F/false as synonyms for True/False"
                print "------------------------------------------------------------------------------"
                traceback.print_exc()
            else:
                traceback.print_exc()

        except Exception, err:
            _err = 1
            traceback.print_exc()

        sys.stdout.flush()
        sys.stderr.flush()
        immediate_exit_with_handlers(_err)

    else:
        # python command provided on the command line...
        _err = 0
        try:
            exec(casa['flags'].execute[0])
        except Exception, err:
            _err = 1
            traceback.print_exc()

        immediate_exit_with_handlers(_err)

else:

    ###
Beispiel #4
0
# 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()
    # Servers make sure to exit here
    from init_welcome_helpers import immediate_exit_with_handlers
    immediate_exit_with_handlers(0)

# jagonzal: MPIClient initialization after watchdog fork
if MPIEnvironment.is_mpi_enabled:
    # Instantiate MPICommunicator singleton in order not to block the clients
    from mpi4casa.MPICommunicator import MPICommunicator
    mpi_comunicator = MPICommunicator()    
    # Post MPI related info
    casalog.post(MPIEnvironment.mpi_info_msg,"INFO","casa" )