Show More
@@ -115,7 +115,7 b' def test_custom_completion_error():' | |||||
115 | class A(object): pass |
|
115 | class A(object): pass | |
116 | ip.user_ns['a'] = A() |
|
116 | ip.user_ns['a'] = A() | |
117 |
|
117 | |||
118 |
@complete_object. |
|
118 | @complete_object.register(A) | |
119 | def complete_A(a, existing_completions): |
|
119 | def complete_A(a, existing_completions): | |
120 | raise TypeError("this should be silenced") |
|
120 | raise TypeError("this should be silenced") | |
121 |
|
121 |
@@ -2,4 +2,4 b'' | |||||
2 | This package contains all third-party modules bundled with IPython. |
|
2 | This package contains all third-party modules bundled with IPython. | |
3 | """ |
|
3 | """ | |
4 |
|
4 | |||
5 |
__all__ = [ |
|
5 | __all__ = [] |
@@ -1,20 +1,18 b'' | |||||
1 | # encoding: utf-8 |
|
1 | # encoding: utf-8 | |
2 | """Generic functions for extending IPython. |
|
2 | """Generic functions for extending IPython. | |
3 |
|
||||
4 | See http://pypi.python.org/pypi/simplegeneric. |
|
|||
5 | """ |
|
3 | """ | |
6 |
|
4 | |||
7 | from IPython.core.error import TryNext |
|
5 | from IPython.core.error import TryNext | |
8 | from simplegeneric import generic |
|
6 | from functools import singledispatch | |
9 |
|
7 | |||
10 |
|
8 | |||
11 | @generic |
|
9 | @singledispatch | |
12 | def inspect_object(obj): |
|
10 | def inspect_object(obj): | |
13 | """Called when you do obj?""" |
|
11 | """Called when you do obj?""" | |
14 | raise TryNext |
|
12 | raise TryNext | |
15 |
|
13 | |||
16 |
|
14 | |||
17 | @generic |
|
15 | @singledispatch | |
18 | def complete_object(obj, prev_completions): |
|
16 | def complete_object(obj, prev_completions): | |
19 | """Custom completer dispatching for python objects. |
|
17 | """Custom completer dispatching for python objects. | |
20 |
|
18 | |||
@@ -30,5 +28,3 b' def complete_object(obj, prev_completions):' | |||||
30 | own_attrs + prev_completions. |
|
28 | own_attrs + prev_completions. | |
31 | """ |
|
29 | """ | |
32 | raise TryNext |
|
30 | raise TryNext | |
33 |
|
||||
34 |
|
@@ -81,7 +81,7 b' class LSString(str):' | |||||
81 | # print arg |
|
81 | # print arg | |
82 | # |
|
82 | # | |
83 | # |
|
83 | # | |
84 |
# print_lsstring = result_display. |
|
84 | # print_lsstring = result_display.register(LSString)(print_lsstring) | |
85 |
|
85 | |||
86 |
|
86 | |||
87 | class SList(list): |
|
87 | class SList(list): | |
@@ -243,7 +243,7 b' class SList(list):' | |||||
243 | # |
|
243 | # | |
244 | # nlprint(arg) # This was a nested list printer, now removed. |
|
244 | # nlprint(arg) # This was a nested list printer, now removed. | |
245 | # |
|
245 | # | |
246 |
# print_slist = result_display. |
|
246 | # print_slist = result_display.register(SList)(print_slist) | |
247 |
|
247 | |||
248 |
|
248 | |||
249 | def indent(instr,nspaces=4, ntabs=0, flatten=False): |
|
249 | def indent(instr,nspaces=4, ntabs=0, flatten=False): |
@@ -188,7 +188,6 b' install_requires = [' | |||||
188 | 'jedi>=0.10', |
|
188 | 'jedi>=0.10', | |
189 | 'decorator', |
|
189 | 'decorator', | |
190 | 'pickleshare', |
|
190 | 'pickleshare', | |
191 | 'simplegeneric>0.8', |
|
|||
192 | 'traitlets>=4.2', |
|
191 | 'traitlets>=4.2', | |
193 | 'prompt_toolkit>=2.0.0,<2.1.0', |
|
192 | 'prompt_toolkit>=2.0.0,<2.1.0', | |
194 | 'pygments', |
|
193 | 'pygments', |
General Comments 0
You need to be logged in to leave comments.
Login now