From patchwork Tue Oct 21 08:18:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 401358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 559E5140095 for ; Tue, 21 Oct 2014 19:43:55 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 4388A1A02B3 for ; Tue, 21 Oct 2014 19:43:55 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lists.ozlabs.org (Postfix) with ESMTP id A2CAB1A0050 for ; Tue, 21 Oct 2014 19:19:15 +1100 (AEDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 21 Oct 2014 01:19:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,760,1406617200"; d="scan'208";a="617730534" Received: from jnikula-mobl.fi.intel.com (HELO localhost) ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP; 21 Oct 2014 01:19:11 -0700 From: Jani Nikula To: patchwork@lists.ozlabs.org Subject: [PATCH 2/2] pwclient: add %{_msgid_} to print message-id without surrounding < and > Date: Tue, 21 Oct 2014 11:18:54 +0300 Message-Id: <1413879534-23830-2-git-send-email-jani.nikula@intel.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1413879534-23830-1-git-send-email-jani.nikula@intel.com> References: <1413879534-23830-1-git-send-email-jani.nikula@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailman-Approved-At: Tue, 21 Oct 2014 19:43:49 +1100 Cc: jani.nikula@intel.com X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" The angle brackets are not really part of the message-id. Making it possible to get the message-id without them is helpful. Signed-off-by: Jani Nikula --- apps/patchwork/bin/pwclient | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient index 1713eb730f85..c88f10b3863e 100755 --- a/apps/patchwork/bin/pwclient +++ b/apps/patchwork/bin/pwclient @@ -142,7 +142,14 @@ def list_patches(patches, format_str=None): def patch_field(matchobj): fieldname = matchobj.group(1) - return str(patch[fieldname]) + + if fieldname == "_msgid_": + # naive way to strip < and > from message-id + val = string.strip(str(patch["msgid"]), "<>") + else: + val = str(patch[fieldname]) + + return val for patch in patches: print(format_field_re.sub(patch_field, format_str))