[PATCH 2/2] pwclient: add %{_msgid_} to print message-id without surrounding < and >

Jani Nikula jani.nikula at intel.com
Tue Oct 21 19:18:54 AEDT 2014


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 <jani.nikula at intel.com>
---
 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))
-- 
2.1.1



More information about the Patchwork mailing list