Skip to content

Commit 853e909

Browse files
committed
remove publish_foo functions
1 parent 7391e81 commit 853e909

3 files changed

Lines changed: 1 addition & 157 deletions

File tree

IPython/core/display.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@
2121

2222
import os
2323

24-
from .displaypub import (
25-
publish_pretty, publish_html,
26-
publish_latex, publish_svg,
27-
publish_png, publish_json,
28-
publish_javascript, publish_jpeg
29-
)
30-
3124
from IPython.utils.py3compat import string_types
3225

3326
#-----------------------------------------------------------------------------

IPython/core/displaypub.py

Lines changed: 1 addition & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
There are two components of the display system:
44
55
* Display formatters, which take a Python object and compute the
6-
representation of the object in various formats (text, HTML, SVg, etc.).
6+
representation of the object in various formats (text, HTML, SVG, etc.).
77
* The display publisher that is used to send the representation data to the
88
various frontends.
99
@@ -162,151 +162,3 @@ def publish_display_data(source, data, metadata=None):
162162
)
163163

164164

165-
def publish_pretty(data, metadata=None):
166-
"""Publish raw text data to all frontends.
167-
168-
Parameters
169-
----------
170-
data : unicode
171-
The raw text data to publish.
172-
metadata : dict
173-
A dictionary for metadata related to the data. This can contain
174-
arbitrary key, value pairs that frontends can use to interpret
175-
the data.
176-
"""
177-
publish_display_data(
178-
u'IPython.core.displaypub.publish_pretty',
179-
{'text/plain':data},
180-
metadata=metadata
181-
)
182-
183-
184-
def publish_html(data, metadata=None):
185-
"""Publish raw HTML data to all frontends.
186-
187-
Parameters
188-
----------
189-
data : unicode
190-
The raw HTML data to publish.
191-
metadata : dict
192-
A dictionary for metadata related to the data. This can contain
193-
arbitrary key, value pairs that frontends can use to interpret
194-
the data.
195-
"""
196-
publish_display_data(
197-
u'IPython.core.displaypub.publish_html',
198-
{'text/html':data},
199-
metadata=metadata
200-
)
201-
202-
203-
def publish_latex(data, metadata=None):
204-
"""Publish raw LaTeX data to all frontends.
205-
206-
Parameters
207-
----------
208-
data : unicode
209-
The raw LaTeX data to publish.
210-
metadata : dict
211-
A dictionary for metadata related to the data. This can contain
212-
arbitrary key, value pairs that frontends can use to interpret
213-
the data.
214-
"""
215-
publish_display_data(
216-
u'IPython.core.displaypub.publish_latex',
217-
{'text/latex':data},
218-
metadata=metadata
219-
)
220-
221-
def publish_png(data, metadata=None):
222-
"""Publish raw binary PNG data to all frontends.
223-
224-
Parameters
225-
----------
226-
data : str/bytes
227-
The raw binary PNG data to publish.
228-
metadata : dict
229-
A dictionary for metadata related to the data. This can contain
230-
arbitrary key, value pairs that frontends can use to interpret
231-
the data.
232-
"""
233-
publish_display_data(
234-
u'IPython.core.displaypub.publish_png',
235-
{'image/png':data},
236-
metadata=metadata
237-
)
238-
239-
240-
def publish_jpeg(data, metadata=None):
241-
"""Publish raw binary JPEG data to all frontends.
242-
243-
Parameters
244-
----------
245-
data : str/bytes
246-
The raw binary JPEG data to publish.
247-
metadata : dict
248-
A dictionary for metadata related to the data. This can contain
249-
arbitrary key, value pairs that frontends can use to interpret
250-
the data.
251-
"""
252-
publish_display_data(
253-
u'IPython.core.displaypub.publish_jpeg',
254-
{'image/jpeg':data},
255-
metadata=metadata
256-
)
257-
258-
259-
def publish_svg(data, metadata=None):
260-
"""Publish raw SVG data to all frontends.
261-
262-
Parameters
263-
----------
264-
data : unicode
265-
The raw SVG data to publish.
266-
metadata : dict
267-
A dictionary for metadata related to the data. This can contain
268-
arbitrary key, value pairs that frontends can use to interpret
269-
the data.
270-
"""
271-
publish_display_data(
272-
u'IPython.core.displaypub.publish_svg',
273-
{'image/svg+xml':data},
274-
metadata=metadata
275-
)
276-
277-
def publish_json(data, metadata=None):
278-
"""Publish raw JSON data to all frontends.
279-
280-
Parameters
281-
----------
282-
data : unicode
283-
The raw JSON data to publish.
284-
metadata : dict
285-
A dictionary for metadata related to the data. This can contain
286-
arbitrary key, value pairs that frontends can use to interpret
287-
the data.
288-
"""
289-
publish_display_data(
290-
u'IPython.core.displaypub.publish_json',
291-
{'application/json':data},
292-
metadata=metadata
293-
)
294-
295-
def publish_javascript(data, metadata=None):
296-
"""Publish raw Javascript data to all frontends.
297-
298-
Parameters
299-
----------
300-
data : unicode
301-
The raw Javascript data to publish.
302-
metadata : dict
303-
A dictionary for metadata related to the data. This can contain
304-
arbitrary key, value pairs that frontends can use to interpret
305-
the data.
306-
"""
307-
publish_display_data(
308-
u'IPython.core.displaypub.publish_javascript',
309-
{'application/javascript':data},
310-
metadata=metadata
311-
)
312-

IPython/display.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
#-----------------------------------------------------------------------------
1414

1515
from IPython.core.display import *
16-
from IPython.core.displaypub import *
1716
from IPython.lib.display import *

0 commit comments

Comments
 (0)