]> git.ozlabs.org Git - patchwork/commitdiff
pwclient: add %{_msgid_} to print message-id without surrounding < and >
authorJani Nikula <jani.nikula@intel.com>
Tue, 21 Oct 2014 08:18:54 +0000 (11:18 +0300)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 10 Nov 2014 12:26:16 +0000 (20:26 +0800)
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@intel.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/bin/pwclient

index 2afccdf604c4bed6a8c95e43224e32861a708825..2a809814a4848272b2311d6d4eaa2e40db4d46fa 100755 (executable)
@@ -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))