##// 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 Enter the object ``item``. If ``attrs`` is specified, it will be used
925 Enter the object ``item``. If ``attrs`` is specified, it will be used
926 as a fixed list of attributes to display.
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 oldlevels = len(self.levels)
932 oldlevels = len(self.levels)
929 self._calcheaderlines(oldlevels+1)
933 self._calcheaderlines(oldlevels+1)
930 try:
934 try:
@@ -943,7 +943,13 b' def xiter(item):'
943 elif _isstr(item):
943 elif _isstr(item):
944 if not item:
944 if not item:
945 raise ValueError("can't enter empty string")
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 return iter(item)
953 return iter(item)
948 else:
954 else:
949 return iter(func()) # iter() just to be safe
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 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
11 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
2
12
3 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
13 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
General Comments 0
You need to be logged in to leave comments. Login now