Show More
@@ -41,8 +41,9 b' def display(obj, include=None, exclude=None):' | |||||
41 | except for those included in this argument. |
|
41 | except for those included in this argument. | |
42 | """ |
|
42 | """ | |
43 | from IPython.core.interactiveshell import InteractiveShell |
|
43 | from IPython.core.interactiveshell import InteractiveShell | |
44 |
|
|
44 | inst = InteractiveShell.instance() | |
45 | publish = InteractiveShell.instance().display_pub.publish |
|
45 | format = inst.display_formatter.format | |
|
46 | publish = inst.display_pub.publish | |||
46 |
|
47 | |||
47 | format_dict = format(obj, include=include, exclude=exclude) |
|
48 | format_dict = format(obj, include=include, exclude=exclude) | |
48 | publish('IPython.core.display.display', format_dict) |
|
49 | publish('IPython.core.display.display', format_dict) |
@@ -195,13 +195,13 b' class DisplayHook(Configurable):' | |||||
195 | type. It is up to frontends to determine pick a MIME to to use and |
|
195 | type. It is up to frontends to determine pick a MIME to to use and | |
196 | display that data in an appropriate manner. |
|
196 | display that data in an appropriate manner. | |
197 |
|
197 | |||
198 |
This method only compute the format data for the object and should |
|
198 | This method only computes the format data for the object and should | |
199 | actually print or write that to a stream. |
|
199 | NOT actually print or write that to a stream. | |
200 |
|
200 | |||
201 | Parameters |
|
201 | Parameters | |
202 | ---------- |
|
202 | ---------- | |
203 | result : object |
|
203 | result : object | |
204 | The Python object passed to the display hook, whose forat will be |
|
204 | The Python object passed to the display hook, whose format will be | |
205 | computed. |
|
205 | computed. | |
206 |
|
206 | |||
207 | Returns |
|
207 | Returns |
@@ -27,6 +27,8 b' Authors:' | |||||
27 | # Imports |
|
27 | # Imports | |
28 | #----------------------------------------------------------------------------- |
|
28 | #----------------------------------------------------------------------------- | |
29 |
|
29 | |||
|
30 | from __future__ import print_function | |||
|
31 | ||||
30 | from IPython.config.configurable import Configurable |
|
32 | from IPython.config.configurable import Configurable | |
31 |
|
33 | |||
32 | #----------------------------------------------------------------------------- |
|
34 | #----------------------------------------------------------------------------- | |
@@ -98,7 +100,7 b' class DisplayPublisher(Configurable):' | |||||
98 | from IPython.utils import io |
|
100 | from IPython.utils import io | |
99 | # The default is to simply write the plain text data using io.Term. |
|
101 | # The default is to simply write the plain text data using io.Term. | |
100 | if data.has_key('text/plain'): |
|
102 | if data.has_key('text/plain'): | |
101 |
print |
|
103 | print(data['text/plain'], file=io.Term.cout) | |
102 |
|
104 | |||
103 |
|
105 | |||
104 | def publish_display_data(self, source, data, metadata=None): |
|
106 | def publish_display_data(self, source, data, metadata=None): |
General Comments 0
You need to be logged in to leave comments.
Login now