示例#1
0
文件: zmqshell.py 项目: dvska/ipython
 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,
     )
示例#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)
示例#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))
示例#4
0
文件: kernel.py 项目: binji/naclports
 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)
示例#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)
示例#8
0
 def write_format_data(self, format_dict, md_dict=None):
     self.content['data'] = encode_images(format_dict)
     self.content['metadata'] = md_dict
示例#9
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
示例#10
0
文件: table.py 项目: jaredly/itreed
def format(value):
    format = InteractiveShell.instance().display_formatter.format
    return encode_images(format(value)[0])
示例#11
0
 def write_format_data(self, format_dict):
     self.msg['content']['data'] = encode_images(format_dict)
示例#12
0
 def write_format_data(self, format_dict):
     self.msg["content"]["data"] = encode_images(format_dict)
示例#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