Changeset 3130
- Timestamp:
- 05/16/17 23:13:37 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/asap
r2929 r3130 2 2 import os 3 3 4 def _main010(): 5 from IPython.Shell import IPShellEmbed 4 def _main500(): 5 from IPython.terminal.prompts import Prompts, Token 6 from traitlets.config.loader import Config 6 7 7 banner = welcome() 8 exit_msg = '' 9 args = ['-colors','Linux','-noconfirm_exit', '-readline', 10 '-xmode', 'Plain', '-autocall', '2', '-autoindent', 11 '-pi1', 'ASAP> ', '-po', 'asap>: ', '-pprint'] 12 ipshell = IPShellEmbed(args,banner,exit_msg) 8 class MyPrompt(Prompts): 9 def in_prompt_tokens(self, cli=None): 10 return [(Token.Prompt, 'ASAP> ')] 11 12 def out_prompt_tokens(self, cli=None): 13 return [(Token.OutPrompt, 'asap>: ')] 14 15 cfg = Config() 16 cfg.TerminalInteractiveShell.colors = "Linux" 17 cfg.TerminalInteractiveShell.prompts_class=MyPrompt 18 from IPython.terminal.embed import InteractiveShellEmbed 19 ipshell = InteractiveShellEmbed(config=cfg, 20 banner1 = welcome(), 21 exit_msg = '') 13 22 return ipshell 14 15 23 16 24 def _main011(): 17 25 from IPython.config.loader import Config … … 41 49 vitems = IPython.__version__.split(".") 42 50 vmaj = int(vitems[0]) 43 vmin = int(vitems[1]) 44 if vmaj == 0: 45 if vmin >= 11: 46 ipshell = _main011() 47 else: 48 ipshell = _main010() 51 if vmaj >= 5: 52 ipshell = _main500() 49 53 else: 50 54 ipshell = _main011() 51 55 ipshell() 52 56 53 57 except ImportError: 54 58 banner = "No ipython found. Running standard python"
Note:
See TracChangeset
for help on using the changeset viewer.