##// END OF EJS Templates
Merge branch 'newkernel' into trunk with all new Qt console work....
Merge branch 'newkernel' into trunk with all new Qt console work. This provides a new main script, ipython-qtconsole, that offers a rich Qt widget capable of multiline editing, inline plots, html help and much more. This branch was developed over the last two months mostly by Evan Patterson, Brian Granger and Fernando Perez, thanks to the support of Enthought, Inc. The code is now in a good prototype stage, and it's being merged into trunk where further work, polishing and stabilization will take place.

File last commit:

r2754:6f2df84b
r3070:95e9a8d0 merge
Show More
displayhook.py
21 lines | 576 B | text/x-python | PythonLexer
import __builtin__
from session import extract_header
class DisplayHook(object):
def __init__(self, session, pub_socket):
self.session = session
self.pub_socket = pub_socket
self.parent_header = {}
def __call__(self, obj):
if obj is None:
return
__builtin__._ = obj
msg = self.session.msg(u'pyout', {u'data':repr(obj)},
parent=self.parent_header)
self.pub_socket.send_json(msg)
def set_parent(self, parent):
self.parent_header = extract_header(parent)