##// END OF EJS Templates
Merge pull request #1363 from minrk/qtstyle...
Merge pull request #1363 from minrk/qtstyle Fix some minor color/style config issues in the qtconsole The tabbed code changed a few things about loading styles and stylesheets in the qtconsole, which this resolves, among a couple other small color-related issues: * tabs other than the first get colors * IPythonWidget.style_sheet configurable is not clobbered by defaults * style_sheet configurable would cause a crash, because _style_sheet_changed could be called before _control existed * fix str->unicode token preventing stylesheets without syntax highlighting from working * fix typo in the function used to detect whether a bgcolor is dark or light

File last commit:

r3880:e7df0ac1
r6095:2b3bc441 merge
Show More
display.py
27 lines | 668 B | text/x-python | PythonLexer
"""Code that shows off the IPython display logic.
"""
from IPython.lib.latextools import latex_to_png
from IPython.core.display import (
display, display_pretty, display_html,
display_svg, display_json, display_png
)
class Circle(object):
def __init__(self, radius):
self.radius = radius
def _repr_pretty_(self, p, cycle):
p.text(u"\u25CB")
def _repr_html_(self):
return "<h1>Cirle: radius=%s</h1>" % self.radius
def _repr_svg_(self):
return """<svg>
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>
</svg>"""
def _repr_png_(self):
return latex_to_png('$\circle$')