From 853e909fce4c79c3282e4865eb98661625f73188 2013-04-29 18:27:47 From: MinRK Date: 2013-04-29 18:27:47 Subject: [PATCH] remove publish_foo functions --- diff --git a/IPython/core/display.py b/IPython/core/display.py index 62c8d77..651185b 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -21,13 +21,6 @@ from __future__ import print_function import os -from .displaypub import ( - publish_pretty, publish_html, - publish_latex, publish_svg, - publish_png, publish_json, - publish_javascript, publish_jpeg -) - from IPython.utils.py3compat import string_types #----------------------------------------------------------------------------- diff --git a/IPython/core/displaypub.py b/IPython/core/displaypub.py index 5aea2fa..c12d873 100644 --- a/IPython/core/displaypub.py +++ b/IPython/core/displaypub.py @@ -3,7 +3,7 @@ There are two components of the display system: * Display formatters, which take a Python object and compute the - representation of the object in various formats (text, HTML, SVg, etc.). + representation of the object in various formats (text, HTML, SVG, etc.). * The display publisher that is used to send the representation data to the various frontends. @@ -162,151 +162,3 @@ def publish_display_data(source, data, metadata=None): ) -def publish_pretty(data, metadata=None): - """Publish raw text data to all frontends. - - Parameters - ---------- - data : unicode - The raw text data to publish. - metadata : dict - A dictionary for metadata related to the data. This can contain - arbitrary key, value pairs that frontends can use to interpret - the data. - """ - publish_display_data( - u'IPython.core.displaypub.publish_pretty', - {'text/plain':data}, - metadata=metadata - ) - - -def publish_html(data, metadata=None): - """Publish raw HTML data to all frontends. - - Parameters - ---------- - data : unicode - The raw HTML data to publish. - metadata : dict - A dictionary for metadata related to the data. This can contain - arbitrary key, value pairs that frontends can use to interpret - the data. - """ - publish_display_data( - u'IPython.core.displaypub.publish_html', - {'text/html':data}, - metadata=metadata - ) - - -def publish_latex(data, metadata=None): - """Publish raw LaTeX data to all frontends. - - Parameters - ---------- - data : unicode - The raw LaTeX data to publish. - metadata : dict - A dictionary for metadata related to the data. This can contain - arbitrary key, value pairs that frontends can use to interpret - the data. - """ - publish_display_data( - u'IPython.core.displaypub.publish_latex', - {'text/latex':data}, - metadata=metadata - ) - -def publish_png(data, metadata=None): - """Publish raw binary PNG data to all frontends. - - Parameters - ---------- - data : str/bytes - The raw binary PNG data to publish. - metadata : dict - A dictionary for metadata related to the data. This can contain - arbitrary key, value pairs that frontends can use to interpret - the data. - """ - publish_display_data( - u'IPython.core.displaypub.publish_png', - {'image/png':data}, - metadata=metadata - ) - - -def publish_jpeg(data, metadata=None): - """Publish raw binary JPEG data to all frontends. - - Parameters - ---------- - data : str/bytes - The raw binary JPEG data to publish. - metadata : dict - A dictionary for metadata related to the data. This can contain - arbitrary key, value pairs that frontends can use to interpret - the data. - """ - publish_display_data( - u'IPython.core.displaypub.publish_jpeg', - {'image/jpeg':data}, - metadata=metadata - ) - - -def publish_svg(data, metadata=None): - """Publish raw SVG data to all frontends. - - Parameters - ---------- - data : unicode - The raw SVG data to publish. - metadata : dict - A dictionary for metadata related to the data. This can contain - arbitrary key, value pairs that frontends can use to interpret - the data. - """ - publish_display_data( - u'IPython.core.displaypub.publish_svg', - {'image/svg+xml':data}, - metadata=metadata - ) - -def publish_json(data, metadata=None): - """Publish raw JSON data to all frontends. - - Parameters - ---------- - data : unicode - The raw JSON data to publish. - metadata : dict - A dictionary for metadata related to the data. This can contain - arbitrary key, value pairs that frontends can use to interpret - the data. - """ - publish_display_data( - u'IPython.core.displaypub.publish_json', - {'application/json':data}, - metadata=metadata - ) - -def publish_javascript(data, metadata=None): - """Publish raw Javascript data to all frontends. - - Parameters - ---------- - data : unicode - The raw Javascript data to publish. - metadata : dict - A dictionary for metadata related to the data. This can contain - arbitrary key, value pairs that frontends can use to interpret - the data. - """ - publish_display_data( - u'IPython.core.displaypub.publish_javascript', - {'application/javascript':data}, - metadata=metadata - ) - diff --git a/IPython/display.py b/IPython/display.py index a887127..7d248ba 100644 --- a/IPython/display.py +++ b/IPython/display.py @@ -13,5 +13,4 @@ #----------------------------------------------------------------------------- from IPython.core.display import * -from IPython.core.displaypub import * from IPython.lib.display import *