Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 82D99431FAF for ; Fri, 24 Aug 2012 10:29:17 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QBlD78mAEhpy for ; Fri, 24 Aug 2012 10:29:15 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 30E55431FAE for ; Fri, 24 Aug 2012 10:29:15 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 75BEE100386; Fri, 24 Aug 2012 20:29:23 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH] contrib/nmbug/nmbug-status: if realname empty, use part of mailaddr Date: Fri, 24 Aug 2012 20:29:21 +0300 Message-Id: <1345829361-29851-1-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 1.7.1 Cc: Tomi Ollila X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2012 17:29:17 -0000 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