Commit 8aec477f authored by Eitan Isaacson's avatar Eitan Isaacson

* plugins/ipython_view.py: Made up/down history not loop (bug #578608).

parent 7214f8fe
2009-05-02 Eitan Isaacson <eitan@ascender.com>
* plugins/ipython_view.py: Made up/down history not loop (bug #578608).
* README:
* accerciser.spec.in:
* debian/control:
......
......@@ -134,6 +134,8 @@ class IterableIPShell:
@rtype: string
'''
self.history_level -= 1
if not self._getHistory():
self.history_level +=1
return self._getHistory()
def historyForward(self):
......@@ -143,7 +145,8 @@ class IterableIPShell:
@return: The command string.
@rtype: string
'''
self.history_level += 1
if self.history_level < 0:
self.history_level += 1
return self._getHistory()
def _getHistory(self):
......@@ -156,7 +159,6 @@ class IterableIPShell:
try:
rv = self.IP.user_ns['In'][self.history_level].strip('\n')
except IndexError:
self.history_level = 0
rv = ''
return rv
......@@ -511,3 +513,11 @@ class IPythonView(ConsoleView, IterableIPShell):
self.showReturned(rv)
self.cout.truncate(0)
if __name__ == "__main__":
window = gtk.Window()
window.set_default_size(640, 320)
window.connect('delete-event', lambda x, y: gtk.main_quit())
window.add(IPythonView())
window.show_all()
gtk.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment