Show More
@@ -1,45 +1,48 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """ Imports and provides the "correct" version of readline for the platform. |
|
3 | 3 | |
|
4 | 4 | Readline is used throughout IPython as "import IPython.rlineimpl as readline. |
|
5 | 5 | |
|
6 | 6 | In addition to normal readline stuff, this module provides have_readline boolean |
|
7 | 7 | and _outputfile variable used in genutils. |
|
8 | 8 | |
|
9 | 9 | $Id: Magic.py 1096 2006-01-28 20:08:02Z vivainio $""" |
|
10 | 10 | |
|
11 | 11 | |
|
12 | 12 | import sys |
|
13 | 13 | |
|
14 | 14 | have_readline = False |
|
15 | 15 | |
|
16 | 16 | if sys.platform == 'win32': |
|
17 | 17 | try: |
|
18 | 18 | from pyreadline import * |
|
19 | 19 | print "Using the new pyreadline (thanks for participating in the testing!)" |
|
20 | 20 | have_readline = True |
|
21 | import pyreadline as _rl | |
|
21 | 22 | except ImportError: |
|
22 |
print " |
|
|
23 | print "IPython team recommends the new pyreadline for Windows use, it wasn't found." | |
|
23 | 24 | print "It's superior especially with non-US keyboard layouts." |
|
24 | 25 | print "Try installing it with 'easy_install pyreadline (ctypes is required) or" |
|
25 | 26 | print "svn co http://ipython.scipy.org/svn/ipython/pyreadline/trunk pyreadline" |
|
26 | 27 | print "Trying 'old' windows readline." |
|
27 | 28 | |
|
28 | 29 | try: |
|
29 | 30 | from readline import * |
|
31 | import readline as _rl | |
|
30 | 32 | have_readline = True |
|
31 | 33 | except ImportError: |
|
32 | 34 | pass |
|
33 | 35 | |
|
34 | 36 | if have_readline: |
|
35 | 37 | try: |
|
36 | _outputfile=GetOutputFile() | |
|
38 | _outputfile=_rl.GetOutputFile() | |
|
37 | 39 | except NameError: |
|
40 | print "Failed GetOutputFile" | |
|
38 | 41 | have_readline = False |
|
39 | 42 | |
|
40 | 43 | else: |
|
41 | 44 | try: |
|
42 | 45 | from readline import * |
|
43 | 46 | have_readline = True |
|
44 | 47 | except ImportError: |
|
45 | 48 | pass |
General Comments 0
You need to be logged in to leave comments.
Login now