Beispiel #1
0
 def publish(self, source, data, metadata=None):
     self._flush_streams()
     if metadata is None:
         metadata = {}
     self._validate_data(source, data, metadata)
     content = {'source': source, 'data': encode_images(data), 'metadata': metadata}
     self.session.send(
         self.pub_socket, u'display_data', json_clean(content),
         parent=self.parent_header, ident=self.topic,
     )
Beispiel #2
0
 def publish(self, source, data, metadata=None):
     self._flush_streams()
     if metadata is None:
         metadata = {}
     self._validate_data(source, data, metadata)
     content = {}
     content["source"] = source
     content["data"] = encode_images(data)
     content["metadata"] = metadata
     sendMessage("iopub", "display_data", content=json_clean(content), parent_header=self.parent_header)
Beispiel #3
0
 def publish(self, source, data, metadata=None):
   self._flush_streams()
   if metadata is None:
     metadata = {}
   self._validate_data(source, data, metadata)
   content = {}
   content['source'] = source
   content['data'] = encode_images(data)
   content['metadata'] = metadata
   iopub_output.put(CreateMessage('display_data', content=json_clean(content),
               parent_header=self.parent_header))
Beispiel #4
0
 def publish(self, source, data, metadata=None):
   self._flush_streams()
   if metadata is None:
     metadata = {}
   self._validate_data(source, data, metadata)
   content = {}
   content['source'] = source
   content['data'] = encode_images(data)
   content['metadata'] = metadata
   sendMessage('iopub', 'display_data', content=json_clean(content),
               parent_header=self.parent_header)
Beispiel #5
0
 def publish(self, data, metadata=None, source=None):
     self._flush_streams()
     if metadata is None:
         metadata = {}
     self._validate_data(data, metadata)
     content = {}
     content["data"] = encode_images(data)
     content["metadata"] = metadata
     self.session.send(
         self.pub_socket, u"display_data", json_clean(content), parent=self.parent_header, ident=self.topic
     )
 def publish(self, source, data, metadata=None):
     self._flush_streams()
     if metadata is None:
         metadata = {}
     self._validate_data(source, data, metadata)
     content = {}
     content['source'] = source
     content['data'] = encode_images(data)
     content['metadata'] = metadata
     self.session.send(
         self.pub_socket, u'display_data', json_clean(content),
         parent=self.parent_header, ident=self.topic,
     )
 def write_format_data(self, format_dict):
     self.msg['content']['data'] = encode_images(format_dict)
Beispiel #8
0
 def write_format_data(self, format_dict, md_dict=None):
     self.content['data'] = encode_images(format_dict)
     self.content['metadata'] = md_dict
 def write_format_data(self, format_dict, md_dict=None):
     self.msg['content']['data'] = encode_images(format_dict)
     self.msg['content']['metadata'] = md_dict
Beispiel #10
0
def format(value):
    format = InteractiveShell.instance().display_formatter.format
    return encode_images(format(value)[0])
Beispiel #11
0
 def write_format_data(self, format_dict):
     self.msg['content']['data'] = encode_images(format_dict)
Beispiel #12
0
 def write_format_data(self, format_dict):
     self.msg["content"]["data"] = encode_images(format_dict)
Beispiel #13
0
 def write_format_data(self, format_dict, md_dict=None):
     self.msg["content"]["data"] = encode_images(format_dict)
     self.msg["content"]["metadata"] = md_dict