[2498] | 1 | #!/usr/bin/env python |
---|
| 2 | import os |
---|
| 3 | |
---|
[2621] | 4 | def main10(): |
---|
| 5 | from IPython.Shell import IPShellEmbed |
---|
| 6 | |
---|
[2623] | 7 | banner = welcome() |
---|
| 8 | exit_msg = '' |
---|
| 9 | args = ['-colors','Linux','-noconfirm_exit', '-readline', |
---|
| 10 | '-xmode', 'Plain', '-autocall', '2', '-auto_indent', |
---|
| 11 | '-pi1', 'ASAP> ', '-po', 'asap>: ', '-pprint'] |
---|
[2621] | 12 | ipshell = IPShellEmbed(sys.argv[1:],banner,exit_msg) |
---|
| 13 | return ipshell |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | def main11(): |
---|
[2498] | 17 | from IPython.config.loader import Config |
---|
| 18 | cfg = Config() |
---|
| 19 | prompt_config = cfg.PromptManager |
---|
| 20 | prompt_config.in_template = 'ASAP> ' |
---|
| 21 | prompt_config.out_template = 'asap>: ' |
---|
| 22 | cfg.InteractiveShell.autoindent = True |
---|
| 23 | cfg.InteractiveShell.autocall = 2 |
---|
| 24 | cfg.InteractiveShell.magic_pprint = True |
---|
| 25 | cfg.InteractiveShell.use_readline=True |
---|
| 26 | cfg.InteractiveShell.confirm_exit=False |
---|
| 27 | cfg.InteractiveShell.xmode='Plain' |
---|
| 28 | |
---|
| 29 | from IPython.frontend.terminal.embed import InteractiveShellEmbed |
---|
| 30 | ipshell = InteractiveShellEmbed(config=cfg, |
---|
| 31 | banner1 = welcome(), |
---|
| 32 | exit_msg = '') |
---|
[2621] | 33 | return ipshell |
---|
[2498] | 34 | |
---|
| 35 | try: |
---|
| 36 | os.system('clear') |
---|
| 37 | import IPython |
---|
[2499] | 38 | from asap import * |
---|
[2621] | 39 | vers = int(IPython.__version__.split(".")[1]) |
---|
| 40 | if vers >= 11: |
---|
| 41 | ipshell = main11() |
---|
| 42 | else: |
---|
| 43 | ipshell = main10() |
---|
[2623] | 44 | ipshell() |
---|
[2621] | 45 | |
---|
[2498] | 46 | except ImportError: |
---|
[2621] | 47 | banner = "No ipython found. Running standard python" |
---|
| 48 | import code |
---|
[2499] | 49 | from asap import * |
---|
[2621] | 50 | del main |
---|
| 51 | code.interact(banner, local=locals()) |
---|