diff --git a/IPython/Extensions/astyle.py b/IPython/Extensions/astyle.py index 8ac0912..4eb29ae 100644 --- a/IPython/Extensions/astyle.py +++ b/IPython/Extensions/astyle.py @@ -256,10 +256,20 @@ class Text(list): for part in self.format(styled): stream.write(part) - def __xrepr__(self, mode="default"): + +try: + from IPython.Extensions import ipipe +except ImportError: + pass +else: + def xrepr_astyle_text(self, mode="default"): yield (-1, True) for info in self: yield info + try: + ipipe.xrepr.when_type(Text)(xrepr_astyle_text) + except Exception: + pass def streamstyle(stream, styled=None): diff --git a/doc/ChangeLog b/doc/ChangeLog index f58da48..ba2e0c2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,6 @@ +2006-11-22 Walter Doerwald + * IPython/Extensions/astyle.py: Text needs it's own implemenation of the + generic xrepr(), otherwise the list implementation would kick in. 2006-11-21 Ville Vainio