Show More
@@ -3,6 +3,7 b' from wcwidth import wcwidth' | |||||
3 |
|
3 | |||
4 | from IPython.utils.py3compat import PY3 |
|
4 | from IPython.utils.py3compat import PY3 | |
5 |
|
5 | |||
|
6 | from IPython.core.completer import IPCompleter | |||
6 | from prompt_toolkit.completion import Completer, Completion |
|
7 | from prompt_toolkit.completion import Completer, Completion | |
7 | from prompt_toolkit.layout.lexers import Lexer |
|
8 | from prompt_toolkit.layout.lexers import Lexer | |
8 | from prompt_toolkit.layout.lexers import PygmentsLexer |
|
9 | from prompt_toolkit.layout.lexers import PygmentsLexer | |
@@ -13,8 +14,11 b' import pygments.lexers as pygments_lexers' | |||||
13 | class IPythonPTCompleter(Completer): |
|
14 | class IPythonPTCompleter(Completer): | |
14 | """Adaptor to provide IPython completions to prompt_toolkit""" |
|
15 | """Adaptor to provide IPython completions to prompt_toolkit""" | |
15 | def __init__(self, shell): |
|
16 | def __init__(self, shell): | |
|
17 | if isinstance(shell, IPCompleter): | |||
|
18 | raise TypeError("IPythonPTCompleter expects an InteractiveShell" | |||
|
19 | " instance in IPython 5.1, not a Completer") | |||
16 | self.shell = shell |
|
20 | self.shell = shell | |
17 |
|
21 | |||
18 | @property |
|
22 | @property | |
19 | def ipy_completer(self): |
|
23 | def ipy_completer(self): | |
20 | return self.shell.Completer |
|
24 | return self.shell.Completer |
General Comments 0
You need to be logged in to leave comments.
Login now