##// END OF EJS Templates
Initial version of DisplayPublisher is working....
Initial version of DisplayPublisher is working. * Backend and frontend implementations. * plain text, html and svg handlers in the Qt console.

File last commit:

r3276:2a5fd2a7
r3276:2a5fd2a7
Show More
displaypub.py
40 lines | 1.4 KiB | text/x-python | PythonLexer
# -*- coding: utf-8 -*-
"""An interface for publishing data related to the display of objects.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2010 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from IPython.config.configurable import Configurable
#-----------------------------------------------------------------------------
# Main payload class
#-----------------------------------------------------------------------------
class DisplayPublisher(Configurable):
def _validate_data(self, source, data, metadata=None):
if not isinstance(source, str):
raise TypeError('source must be a str, got: %r' % source)
if not isinstance(data, dict):
raise TypeError('data must be a dict, got: %r' % data)
if metadata is not None:
if not isinstance(metadata, dict):
raise TypeError('metadata must be a dict, got: %r' % data)
def publish(self, source, data, metadata=None):
"""Publish data and metadata to all frontends."""
pass