diff options
author | Jani Nikula <jani.nikula@intel.com> | 2014-10-21 11:18:54 +0300 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-11-10 20:26:16 +0800 |
commit | ee50829bb8922628ae01df75403d8de088c01b9c (patch) | |
tree | db769893d7e27cd042197911a6928d7d20bea5ad /apps | |
parent | 4f152d818977fb6a9f1ca1b38f88253cf61a8c73 (diff) | |
download | patchwork-ee50829bb8922628ae01df75403d8de088c01b9c.tar.bz2 patchwork-ee50829bb8922628ae01df75403d8de088c01b9c.tar.xz |
pwclient: add %{_msgid_} to print message-id without surrounding < and >
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>
Diffstat (limited to 'apps')
-rwxr-xr-x | apps/patchwork/bin/pwclient | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient index 2afccdf..2a80981 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)) |