##// END OF EJS Templates
Initial version of DisplayPublisher is working....
Brian Granger -
Show More
@@ -0,0 +1,40 b''
1 # -*- coding: utf-8 -*-
2 """An interface for publishing data related to the display of objects.
3
4 Authors:
5
6 * Brian Granger
7 """
8
9 #-----------------------------------------------------------------------------
10 # Copyright (C) 2008-2010 The IPython Development Team
11 #
12 # Distributed under the terms of the BSD License. The full license is in
13 # the file COPYING, distributed as part of this software.
14 #-----------------------------------------------------------------------------
15
16 #-----------------------------------------------------------------------------
17 # Imports
18 #-----------------------------------------------------------------------------
19
20 from IPython.config.configurable import Configurable
21
22 #-----------------------------------------------------------------------------
23 # Main payload class
24 #-----------------------------------------------------------------------------
25
26 class DisplayPublisher(Configurable):
27
28 def _validate_data(self, source, data, metadata=None):
29 if not isinstance(source, str):
30 raise TypeError('source must be a str, got: %r' % source)
31 if not isinstance(data, dict):
32 raise TypeError('data must be a dict, got: %r' % data)
33 if metadata is not None:
34 if not isinstance(metadata, dict):
35 raise TypeError('metadata must be a dict, got: %r' % data)
36
37 def publish(self, source, data, metadata=None):
38 """Publish data and metadata to all frontends."""
39 pass
40
General Comments 0
You need to be logged in to leave comments. Login now