##// END OF EJS Templates
Merge pull request #4305 from minrk/even-more-ways-to-get-ifaces...
Merge pull request #4305 from minrk/even-more-ways-to-get-ifaces Add even more ways to populate localinterfaces use netifaces for faster IPython.utils.localinterfaces when availlable, Parse subprocess output from ifconfig / ip addr / ipconfig. Lower priority than netifaces, but still higher priority than socket.gethostbyname. Fallback to gethostname otherwise. Should be much faster in worst case scenario where machine are badly configurred and can wait up to ~30s to start ipython. Slighly slower in other cases.

File last commit:

r9190:20a102a5
r12911:aeeb7f5a 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$')