[PATCH] contrib/nmbug/nmbug-status: if realname empty, use part of mailaddr

Tomi Ollila tomi.ollila at iki.fi
Fri Aug 24 10:29:21 PDT 2012


When the From: field in patch email does not contain 'realname'
field, the patch listing does not show anything as patch sender.
In this case use the part before '@' in mail address as the sender
identification in patch listing.
---
 contrib/nmbug/nmbug-status |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/contrib/nmbug/nmbug-status b/contrib/nmbug/nmbug-status
index f37ee84..9a334cc 100755
--- a/contrib/nmbug/nmbug-status
+++ b/contrib/nmbug/nmbug-status
@@ -90,7 +90,9 @@ def print_view(title, query, comment):
                 val = str.join(' ', val.split(None)[1:4])
                 val = str(datetime.datetime.strptime(val, '%d %b %Y').date())
             elif header == 'from':
-                val = rfc822.parseaddr(val)[0]
+                (val, addr) = rfc822.parseaddr(val)
+                if val == '':
+                    val = addr.split('@')[0]
 
             if last[header] == val:
                 out[header] = ''
-- 
1.7.1



More information about the notmuch mailing list