def write_line(self, line): displaypub.publish_javascript( 'document.%s.append($("<div>%s</div>"));' % ( self.output_id, cgi.escape(line)))
def finalize(self): displaypub.publish_javascript('delete document.%s;' % self.output_id)
def write_chars(self, chars): displaypub.publish_javascript( 'document.%s.append($("<span>%s</span>"));' % ( self.output_id, cgi.escape(chars)))
def __init__(self): self.output_id = 'ipython_nose_%s' % uuid.uuid4().hex displaypub.publish_html( '<div id="%s"></div>' % self.output_id) displaypub.publish_javascript( 'document.%s = $("#%s");' % (self.output_id, self.output_id))