diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-12-02 21:48:19 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-12-15 22:03:55 +0000 |
commit | 29065fad1fd4fa9da10d3514e052f0da33da3863 (patch) | |
tree | 9519e71aba807512d67c31349a1372300d705545 | |
parent | 09804636609b4245cde4faceddffdb5361f3d390 (diff) | |
parent | ace13f292d9a780ccefab3bcec01b97e6e98748f (diff) |
Merge branch '0.3.3-fix-authors-530'
-rw-r--r-- | alot/helper.py | 8 | ||||
-rw-r--r-- | docs/source/conf.py | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/alot/helper.py b/alot/helper.py index 6cb8d82c..2df22493 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -5,7 +5,6 @@ from datetime import timedelta from datetime import datetime from collections import deque -from string import strip import subprocess import shlex import email @@ -179,7 +178,9 @@ def shorten_author_string(authors_string, maxlength): short_names = len(authors_string) > maxlength for au in authors_string.split(", "): if short_names: - authors.append(strip(au.split()[0])) + author_as_list = au.split() + if len(author_as_list) > 0: + authors.append(author_as_list[0]) else: authors.append(au) @@ -187,6 +188,9 @@ def shorten_author_string(authors_string, maxlength): # concatenated using commas for the final formatted author_string. authors_chain = deque() + if len(authors) == 0: + return u'' + # reserve space for first author first_au = shorten(authors.popleft(), maxlength) remaining_length = maxlength - len(first_au) diff --git a/docs/source/conf.py b/docs/source/conf.py index 030c19c3..3c4a02b7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -32,6 +32,7 @@ MOCK_MODULES = ['twisted', 'twisted.internet', 'urwid', 'magic', 'gpgme', + 'configobj', 'argparse'] MOCK_DIRTY = ['notmuch'] for mod_name in MOCK_MODULES: |