##// END OF EJS Templates
IPython/Extensions/ipipe.py (xiter): Make sure that iterating...
walter.doerwald -
Show More
@@ -925,6 +925,10 b' class ibrowse(ipipe.Display):'
925 925 Enter the object ``item``. If ``attrs`` is specified, it will be used
926 926 as a fixed list of attributes to display.
927 927 """
928 if self.levels and item is self.levels[-1].input:
929 curses.beep()
930 self.report(CommandError("Recursion on input object"))
931 else:
928 932 oldlevels = len(self.levels)
929 933 self._calcheaderlines(oldlevels+1)
930 934 try:
@@ -943,7 +943,13 b' def xiter(item):'
943 943 elif _isstr(item):
944 944 if not item:
945 945 raise ValueError("can't enter empty string")
946 return iter(item.splitlines())
946 lines = item.splitlines()
947 if len(lines) == 1:
948 def iterone(item):
949 yield item
950 return iterone(item)
951 else:
952 return iter(lines)
947 953 return iter(item)
948 954 else:
949 955 return iter(func()) # iter() just to be safe
@@ -1,3 +1,13 b''
1 2007-01-23 Walter Doerwald <walter@livinglogic.de>
2
3 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
4 a string containing a single line yields the string itself as the
5 only item.
6
7 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
8 object if it's the same as the one on the last level (This avoids
9 infinite recursion for one line strings).
10
1 11 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2 12
3 13 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
General Comments 0
You need to be logged in to leave comments. Login now