Show More
@@ -256,10 +256,20 b' class Text(list):' | |||||
256 | for part in self.format(styled): |
|
256 | for part in self.format(styled): | |
257 | stream.write(part) |
|
257 | stream.write(part) | |
258 |
|
258 | |||
259 | def __xrepr__(self, mode="default"): |
|
259 | ||
|
260 | try: | |||
|
261 | from IPython.Extensions import ipipe | |||
|
262 | except ImportError: | |||
|
263 | pass | |||
|
264 | else: | |||
|
265 | def xrepr_astyle_text(self, mode="default"): | |||
260 | yield (-1, True) |
|
266 | yield (-1, True) | |
261 | for info in self: |
|
267 | for info in self: | |
262 | yield info |
|
268 | yield info | |
|
269 | try: | |||
|
270 | ipipe.xrepr.when_type(Text)(xrepr_astyle_text) | |||
|
271 | except Exception: | |||
|
272 | pass | |||
263 |
|
273 | |||
264 |
|
274 | |||
265 | def streamstyle(stream, styled=None): |
|
275 | def streamstyle(stream, styled=None): |
@@ -1,3 +1,6 b'' | |||||
|
1 | 2006-11-22 Walter Doerwald <walter@livinglogic.de> | |||
|
2 | * IPython/Extensions/astyle.py: Text needs it's own implemenation of the | |||
|
3 | generic xrepr(), otherwise the list implementation would kick in. | |||
1 |
|
4 | |||
2 | 2006-11-21 Ville Vainio <vivainio@gmail.com> |
|
5 | 2006-11-21 Ville Vainio <vivainio@gmail.com> | |
3 |
|
6 |
General Comments 0
You need to be logged in to leave comments.
Login now