diff options
author | Andy Grover <agrover@redhat.com> | 2013-01-15 10:45:06 -0800 |
---|---|---|
committer | Andy Grover <agrover@redhat.com> | 2013-01-15 10:45:06 -0800 |
commit | 46ef8a98083ab22d0120936af73b38b0e36c249d (patch) | |
tree | 96195bea1cb2d78008cb1864146a15ae5db0866c /configshell | |
parent | 359e3a498456a5822b9b41d88e004fb6c625bcc4 (diff) | |
download | configshell-fb-46ef8a98083ab22d0120936af73b38b0e36c249d.tar.gz |
Avoid exception when arrowing down past end of list
I have a feeling that urwid has a more elegant way to handle scrolling
behavior, but it wasn't very obvious, so this works.
Signed-off-by: Andy Grover <agrover@redhat.com>
Diffstat (limited to 'configshell')
-rw-r--r-- | configshell/node.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/configshell/node.py b/configshell/node.py index 7ce98a4..42ee948 100644 --- a/configshell/node.py +++ b/configshell/node.py @@ -1086,7 +1086,10 @@ class ConfigNode(object): if pos > 0: content.set_focus(pos-1) elif unicode(key) == 'down': - content.set_focus(pos+1) + try: + content.set_focus(pos+1) + except IndexError: + pass elif unicode(key) == 'enter': raise Selected(pos) |