summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-10-21 10:33:19 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-10-21 10:33:19 +0100
commite9bbee5f6ff00b3a3d2fd941f673a4a002ffee6b (patch)
treef1ddcfd5ceec5a5e153f61f1972211555261b4db /alot
parent58ba7f2fc37c4de2b480a27e4319690892a6695c (diff)
deal with date == None in ThreadLineWidget
issue #46
Diffstat (limited to 'alot')
-rw-r--r--alot/widgets.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/alot/widgets.py b/alot/widgets.py
index 6a50dd6c..c57d5982 100644
--- a/alot/widgets.py
+++ b/alot/widgets.py
@@ -83,12 +83,15 @@ class ThreadlineWidget(urwid.AttrMap):
def rebuild(self):
cols = []
- formatstring = config.get('general', 'timestamp_format')
newest = self.thread.get_newest_date()
- if formatstring:
- datestring = newest.strftime(formatstring)
+ if newest == None:
+ datestring = u' ' * 10
else:
- datestring = pretty_datetime(newest).rjust(10)
+ formatstring = config.get('general', 'timestamp_format')
+ if formatstring:
+ datestring = newest.strftime(formatstring)
+ else:
+ datestring = pretty_datetime(newest).rjust(10)
self.date_w = urwid.AttrMap(urwid.Text(datestring), 'threadline_date')
cols.append(('fixed', len(datestring), self.date_w))