#!/usr/bin/env python
import os

def main():
    from IPython.config.loader import Config
    cfg = Config()
    prompt_config = cfg.PromptManager
    prompt_config.in_template = 'ASAP> '
    prompt_config.out_template = 'asap>: '
    cfg.InteractiveShell.autoindent = True
    cfg.InteractiveShell.autocall = 2
    cfg.InteractiveShell.magic_pprint = True
    cfg.InteractiveShell.use_readline=True
    cfg.InteractiveShell.confirm_exit=False
    cfg.InteractiveShell.xmode='Plain'

    from IPython.frontend.terminal.embed import InteractiveShellEmbed
    ipshell = InteractiveShellEmbed(config=cfg,
                                    banner1 = welcome(),
                                    exit_msg = '')
    ipshell()

try: 
    os.system('clear')
    import IPython
    from asap import *
    main()
except ImportError:
    print "No ipython found. Running standard python"
    from asap import *
