summaryrefslogtreecommitdiff
path: root/alot/ui.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-01-11 15:34:56 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2012-01-11 15:35:27 +0000
commit50cb4629974c582eb6254c66dc7147d5bd53c669 (patch)
tree12466c9270a785af59e32629a58c917a01b595eb /alot/ui.py
parent943fe637e450262495c103e5136f683562522671 (diff)
fix ui.build_statusbar if current_buffer is None
just display "[no buffers]" instead of buffer info in that case
Diffstat (limited to 'alot/ui.py')
-rw-r--r--alot/ui.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/alot/ui.py b/alot/ui.py
index ad7abe6a..21899dc9 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -408,8 +408,11 @@ class UI(object):
def build_statusbar(self):
"""construct and return statusbar widget"""
- idx = self.buffers.index(self.current_buffer)
- lefttxt = '%d: %s' % (idx, self.current_buffer)
+ if self.current_buffer is not None:
+ idx = self.buffers.index(self.current_buffer)
+ lefttxt = '%d: %s' % (idx, self.current_buffer)
+ else:
+ lefttxt = '[no buffers]'
footerleft = urwid.Text(lefttxt, align='left')
righttxt = 'total messages: %d' % self.dbman.count_messages('*')
pending_writes = len(self.dbman.writequeue)