1 Return-Path: <wking@tremily.us>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id ED65A6DE1A20
\r
6 for <notmuch@notmuchmail.org>; Wed, 30 Dec 2015 11:29:21 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
10 X-Spam-Score: -0.012
\r
12 X-Spam-Status: No, score=-0.012 tagged_above=-999 required=5 tests=[AWL=0.089,
\r
13 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
14 RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled
\r
15 Received: from arlo.cworth.org ([127.0.0.1])
\r
16 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id sOeknRauquNS for <notmuch@notmuchmail.org>;
\r
18 Wed, 30 Dec 2015 11:29:20 -0800 (PST)
\r
19 Received: from resqmta-po-10v.sys.comcast.net (resqmta-po-10v.sys.comcast.net
\r
21 by arlo.cworth.org (Postfix) with ESMTPS id C2A836DE1A0E
\r
22 for <notmuch@notmuchmail.org>; Wed, 30 Dec 2015 11:29:19 -0800 (PST)
\r
23 Received: from resomta-po-03v.sys.comcast.net ([96.114.154.227])
\r
24 by resqmta-po-10v.sys.comcast.net with comcast
\r
25 id zvQK1r0024ueUHc01vQKt6; Wed, 30 Dec 2015 19:24:19 +0000
\r
26 Received: from mail.tremily.us ([73.221.72.168])
\r
27 by resomta-po-03v.sys.comcast.net with comcast
\r
28 id zvNJ1r00D3dr3C901vNJEo; Wed, 30 Dec 2015 19:22:19 +0000
\r
29 Received: by mail.tremily.us (Postfix, from userid 1000)
\r
30 id 6A98E1B2C3DE; Wed, 30 Dec 2015 11:22:18 -0800 (PST)
\r
31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin;
\r
32 t=1451503338; bh=tk+6BE9cwA7KEGMk/RW7QHXvxUJjWFx0oRrqkFUFt1Q=;
\r
33 h=Resent-From:Resent-Date:Resent-To:From:To:Cc:Subject:Date:
\r
34 In-Reply-To:References:In-Reply-To:References;
\r
35 b=Tb2jozfeQz/E1iJDZySQ44y1ZR+WtGgtBP8QZucXOevKJNMM7fMNaU/aq083GI4nU
\r
36 kkA6FZ3t7W00ZcbkkB0II7JVrxWH6kRnhMRcXqsjjOvlYToNVtv6v5ELvunJTRVbso
\r
37 Lmty72cI82dJuUIf76qu15Cg+T5/kGYD3A2GZtZY=
\r
38 Resent-From: "W. Trevor King" <wking@tremily.us>
\r
39 Resent-Date: Wed, 30 Dec 2015 11:22:18 -0800
\r
40 Resent-Message-ID: <20151230192218.GC2452@odin.tremily.us>
\r
41 Resent-To: notmuch@notmuchmail.org
\r
42 From: "W. Trevor King" <wking@tremily.us>
\r
43 To: notmuch@notmuchmail.org
\r
44 Cc: David Bremner <david@tethera.net>,
\r
45 Tomi Ollila <tomi.ollila@iki.fi>, Jani Nikula <jani@nikula.org>,
\r
46 Carl Worth <cworth@cworth.org>, "W. Trevor King" <wking@tremily.us>
\r
47 Subject: [PATCH 2/5] nmbug-status: Add meta.message-url config setting
\r
48 Date: Wed, 30 Dec 2015 11:16:57 -0800
\r
50 <9377a4c1265b13f9588d21ec0ea591ea9f61a05f.1451502495.git.wking@tremily.us>
\r
51 X-Mailer: git-send-email 2.1.0.60.g85f0837
\r
52 In-Reply-To: <cover.1451502495.git.wking@tremily.us>
\r
53 References: <cover.1451502495.git.wking@tremily.us>
\r
54 In-Reply-To: <cover.1451502495.git.wking@tremily.us>
\r
55 References: <cover.1451502495.git.wking@tremily.us>
\r
56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
57 s=q20140121; t=1451503459;
\r
58 bh=Nnq9N1s17J4Xjz52SmfpWDWNd2bbsmDF/Pmv79592wg=;
\r
59 h=Received:Received:Received:From:To:Subject:Date:Message-Id;
\r
60 b=BmDgaFIIapYcKVf9vWLhtfRzPQ7tfdMcZUZtuwhxJJ9V9d0BKi9fQgR5z9D2WH6tl
\r
61 LHfWfISkQ1AszZ6jM5fDT+s3nGnIgJI0gyn1R8lYtALxDOJz0Qm611w2oG9Aht//zI
\r
62 tWa9VjRo5QK4uT//fgZjscj7IRl3KxMTJ5jTJxxGXqolmVR9dRdtzjDxGPtHLctRh2
\r
63 pOJO7yoh7VhFgR3T8IO4XYU9oKm3g0fRSgg6L01YJbQFVh7iLF9/19JcP6f7T8XzvG
\r
64 Bz6Yp+jh1vCkI8W0LJLF5cPnAEVAi6F7Mimm9lax0MJHA7Rof2gBmHVY2EktxIPYeH
\r
66 X-BeenThere: notmuch@notmuchmail.org
\r
67 X-Mailman-Version: 2.1.20
\r
69 List-Id: "Use and development of the notmuch mail system."
\r
70 <notmuch.notmuchmail.org>
\r
71 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
74 List-Post: <mailto:notmuch@notmuchmail.org>
\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
76 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
77 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
78 X-List-Received-Date: Wed, 30 Dec 2015 19:29:22 -0000
\r
80 So you can link to archives other than Gmane. For example, I'm doing
\r
83 [1]: https://github.com/wking/nmbug-oci
\r
85 NEWS | 20 ++++++++++++++++++++
\r
86 devel/nmbug/nmbug-status | 13 ++++++++++---
\r
87 2 files changed, 30 insertions(+), 3 deletions(-)
\r
89 diff --git a/NEWS b/NEWS
\r
90 index 0a7a0e0..9f2e860 100644
\r
94 +Notmuch 0.22 (UNRELEASED)
\r
95 +=========================
\r
100 +`nmbug-status` now supports `meta.message-url` to override the Gmane
\r
101 +template. For example, you can use:
\r
105 + "message-url": "https://groups.google.com/a/opencontainers.org/forum/#!search/messageid$3A%22{message-id}%22"
\r
111 +To link to messages in the [opencontainers.org Google
\r
112 +Groups](https://groups.google.com/a/opencontainers.org/forum/#!overview).
\r
114 Notmuch 0.21 (2015-10-29)
\r
115 =========================
\r
117 diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status
\r
118 index b36b6ad..d72f1db 100755
\r
119 --- a/devel/nmbug/nmbug-status
\r
120 +++ b/devel/nmbug/nmbug-status
\r
121 @@ -19,11 +19,11 @@
\r
122 # You should have received a copy of the GNU General Public License
\r
123 # along with this program. If not, see http://www.gnu.org/licenses/ .
\r
125 -"""Generate HTML for one or more notmuch searches.
\r
126 +"""Generate text and/or HTML for one or more notmuch searches.
\r
128 Messages matching each search are grouped by thread. Each message
\r
129 that contains both a subject and message-id will have the displayed
\r
130 -subject link to the Gmane view of the message.
\r
131 +subject link to an archive view of the message (defaulting to Gmane).
\r
134 from __future__ import print_function
\r
135 @@ -232,6 +232,10 @@ class Page (object):
\r
136 class HtmlPage (Page):
\r
137 _slug_regexp = re.compile('\W+')
\r
139 + def __init__(self, message_url_template, **kwargs):
\r
140 + self.message_url_template = message_url_template
\r
141 + super(HtmlPage, self).__init__(**kwargs)
\r
143 def _write_header(self, views, stream):
\r
144 super(HtmlPage, self)._write_header(views=views, stream=stream)
\r
145 stream.write('<ul>\n')
\r
146 @@ -292,8 +296,9 @@ class HtmlPage (Page):
\r
147 'message-id': quote(display_data['message-id']),
\r
148 'subject': xml.sax.saxutils.escape(display_data['subject']),
\r
150 + d['url'] = self.message_url_template.format(**d)
\r
151 display_data['subject'] = (
\r
152 - '<a href="http://mid.gmane.org/{message-id}">{subject}</a>'
\r
153 + '<a href="{url}">{subject}</a>'
\r
155 for key in ['message-id', 'from']:
\r
156 if key in display_data:
\r
157 @@ -395,6 +400,8 @@ _PAGES['text'] = Page()
\r
158 _PAGES['html'] = HtmlPage(
\r
159 header=header_template.format(**context),
\r
160 footer=footer_template.format(**context),
\r
161 + message_url_template=config['meta'].get(
\r
162 + 'message-url', 'http://mid.gmane.org/{message-id}'),
\r
165 if args.list_views:
\r