##// END OF EJS Templates
check if readline is available before calling readline functions in ipy_defaults.py
jstenar -
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -1,59 +1,60 b''
1 1 """ Set default options for IPython.
2 2
3 3 Just import this module to get reasonable defaults for everything.
4 4
5 5 These configurations used to be performed in ipythonrc (or ipythonrc.ini).
6 6 Therefore importing this in your config files makes ipython basically
7 7 ignore your ipythonrc. This is *not* imported by default, you need to import
8 8 this manually in one of your config files.
9 9
10 10 You can further override these defaults in e.g. your ipy_user_config.py,
11 11 ipy_profile_PROFILENAME etc.
12 12
13 13 """
14 14
15 15 import IPython.rlineimpl as readline
16 16 import IPython.ipapi
17 17 ip = IPython.ipapi.get()
18 18
19 19 o = ip.options
20 20
21 21 o.colors = "Linux"
22 22 o.color_info=1
23 23 o.confirm_exit=1
24 24 o.pprint=1
25 25 o.multi_line_specials=1
26 26 o.xmode="Context"
27 27
28 28
29 29 o.prompt_in1='In [\#]: '
30 30 o.prompt_in2 =' .\D.: '
31 31 o.prompt_out = 'Out[\#]: '
32 32 o.prompts_pad_left=1
33 33
34 34 o.readline_remove_delims="-/~"
35 35 o.readline_merge_completions=1
36 36
37 37 o.readline = 1
38 38
39 39 rlopts = """\
40 40 tab: complete
41 41 "\C-l": possible-completions
42 42 set show-all-if-ambiguous on
43 43 "\C-o": tab-insert
44 44 "\M-i": " "
45 45 "\M-o": "\d\d\d\d"
46 46 "\M-I": "\d\d\d\d"
47 47 "\C-r": reverse-search-history
48 48 "\C-s": forward-search-history
49 49 "\C-p": history-search-backward
50 50 "\C-n": history-search-forward
51 51 "\e[A": history-search-backward
52 52 "\e[B": history-search-forward
53 53 "\C-k": kill-line
54 54 "\C-u": unix-line-discard"""
55 55
56 for cmd in rlopts.split('\n'):
57 readline.parse_and_bind(cmd)
56 if readline.have_readline:
57 for cmd in rlopts.split('\n'):
58 readline.parse_and_bind(cmd)
58 59
59 60
1 NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
General Comments 0
You need to be logged in to leave comments. Login now