Last change
on this file since 2814 was
2814,
checked in by Malte Marquarding, 11 years ago
|
Issue #292: revert tpo python without breaking
|
File size:
1.4 KB
|
Rev | Line | |
---|
[2498] | 1 | #!/usr/bin/env python |
---|
| 2 | import os |
---|
| 3 | |
---|
[2814] | 4 | def _main10(): |
---|
[2621] | 5 | from IPython.Shell import IPShellEmbed |
---|
| 6 | |
---|
[2623] | 7 | banner = welcome() |
---|
| 8 | exit_msg = '' |
---|
| 9 | args = ['-colors','Linux','-noconfirm_exit', '-readline', |
---|
[2651] | 10 | '-xmode', 'Plain', '-autocall', '2', '-autoindent', |
---|
[2623] | 11 | '-pi1', 'ASAP> ', '-po', 'asap>: ', '-pprint'] |
---|
[2651] | 12 | ipshell = IPShellEmbed(args,banner,exit_msg) |
---|
[2621] | 13 | return ipshell |
---|
| 14 | |
---|
| 15 | |
---|
[2814] | 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: |
---|
[2814] | 41 | ipshell = _main11() |
---|
[2621] | 42 | else: |
---|
[2814] | 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 | code.interact(banner, local=locals()) |
---|
Note: See
TracBrowser
for help on using the repository browser.