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 olra.theworths.org (Postfix) with ESMTP id 2851F431FAE
\r
6 for <notmuch@notmuchmail.org>; Sat, 31 May 2014 15:21:19 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5
\r
13 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id DQgtdVI3Elzl for <notmuch@notmuchmail.org>;
\r
18 Sat, 31 May 2014 15:21:15 -0700 (PDT)
\r
19 Received: from qmta03.westchester.pa.mail.comcast.net
\r
20 (qmta03.westchester.pa.mail.comcast.net [76.96.62.32])
\r
21 by olra.theworths.org (Postfix) with ESMTP id 7C01E431FD8
\r
22 for <notmuch@notmuchmail.org>; Sat, 31 May 2014 15:21:03 -0700 (PDT)
\r
23 Received: from omta24.westchester.pa.mail.comcast.net ([76.96.62.76])
\r
24 by qmta03.westchester.pa.mail.comcast.net with comcast
\r
25 id 8mL81o0031ei1Bg53mM33L; Sat, 31 May 2014 22:21:03 +0000
\r
26 Received: from odin.tremily.us ([24.18.63.50])
\r
27 by omta24.westchester.pa.mail.comcast.net with comcast
\r
28 id 8mM11o00f152l3L3kmM2LP; Sat, 31 May 2014 22:21:03 +0000
\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])
\r
30 by odin.tremily.us (Postfix) with ESMTPS id 3DC1311F065C;
\r
31 Sat, 31 May 2014 15:21:01 -0700 (PDT)
\r
32 Received: (nullmailer pid 13199 invoked by uid 1000);
\r
33 Sat, 31 May 2014 22:20:38 -0000
\r
34 From: "W. Trevor King" <wking@tremily.us>
\r
35 To: notmuch@notmuchmail.org
\r
36 Subject: [PATCH v2 6/6] nmbug-status: Optionally load the header and footer
\r
37 templates from the config
\r
38 Date: Sat, 31 May 2014 15:20:27 -0700
\r
40 <1d1e7c71bb4b55fc501411381fda5e2421ca6fe2.1401574293.git.wking@tremily.us>
\r
41 X-Mailer: git-send-email 1.9.1.353.gc66d89d
\r
42 In-Reply-To: <cover.1401574293.git.wking@tremily.us>
\r
43 References: <cover.1401574293.git.wking@tremily.us>
\r
44 In-Reply-To: <cover.1401574293.git.wking@tremily.us>
\r
45 References: <cover.1401574293.git.wking@tremily.us>
\r
46 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
47 s=q20140121; t=1401574863;
\r
48 bh=iqON0OSdx9Fr65Ee3et5C5RrRmOatQ04fRvSTNG6heY=;
\r
49 h=Received:Received:Received:Received:From:To:Subject:Date:
\r
51 b=htGwYK9t/18IWypQqH+M/crGfgKX+h8liMzVx7pxpumBnY2wo8d/QygEYoL2Kvcut
\r
52 mWu7QVRlOCqVK7rptHgOrh5OVF/lkjBFZ2HIFB69ecWaj9cKDEr+Kg2I/2dNppBDIq
\r
53 95Uoj337zN/x/7R6D1hT86e5khQshwShX1DPJWfUTLXwSR+z5sJp10ExeLMDjJ5mAa
\r
54 G5U+eX1VQ9oEmMY0LGW7m7k+mQz/R3YsqByT5zEWr79Ntb0+iElaSkdXjQuQPyt2fS
\r
55 eTltNyUiyWhze5qyRGKZOMyvOnWdfTe1fuzD41vs3kodoXBi0WEm/THI1h+GT7+bQJ
\r
57 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Sat, 31 May 2014 22:21:19 -0000
\r
72 For folks that don't like the default templates for whatever reason.
\r
74 NEWS | 18 ++++++++++++++++++
\r
75 devel/nmbug/nmbug-status | 37 +++++++++++++++++++++----------------
\r
76 2 files changed, 39 insertions(+), 16 deletions(-)
\r
78 diff --git a/NEWS b/NEWS
\r
79 index 5d85733..ab6f9e4 100644
\r
83 +Notmuch 0.19 (UNRELEASED)
\r
84 +=========================
\r
89 +`nmbug-status` can now optionally load header and footer templates
\r
90 +from the config file. Use something like:
\r
94 + "header": "<!DOCTYPE html>\n<html lang="en">\n...",
\r
95 + "footer": "</body></html>",
\r
101 Notmuch 0.18 (2014-05-06)
\r
102 =========================
\r
104 diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status
\r
105 index c0bdd1b..f0809f1 100755
\r
106 --- a/devel/nmbug/nmbug-status
\r
107 +++ b/devel/nmbug/nmbug-status
\r
108 @@ -275,20 +275,8 @@ parser.add_argument('--get-query', help='get query for view',
\r
109 args = parser.parse_args()
\r
111 config = read_config(path=args.config)
\r
112 -now = datetime.datetime.utcnow()
\r
115 - 'datetime': now.strftime('%Y-%m-%d %H:%M:%SZ'),
\r
116 - 'title': config['meta']['title'],
\r
117 - 'blurb': config['meta']['blurb'],
\r
118 - 'encoding': _ENCODING,
\r
119 - 'inter_message_padding': '0.25em',
\r
120 - 'border_radius': '0.5em',
\r
123 -_PAGES['text'] = Page()
\r
124 -_PAGES['html'] = HtmlPage(
\r
125 - header='''<!DOCTYPE html>
\r
126 +header_template = config['meta'].get('header', '''<!DOCTYPE html>
\r
129 <meta http-equiv="Content-Type" content="text/html; charset={encoding}" />
\r
130 @@ -338,13 +326,30 @@ _PAGES['html'] = HtmlPage(
\r
134 -'''.format(**context),
\r
138 +footer_template = config['meta'].get('footer', '''
\r
140 <p>Generated: {datetime}
\r
143 -'''.format(**context),
\r
146 +now = datetime.datetime.utcnow()
\r
149 + 'datetime': now.strftime('%Y-%m-%d %H:%M:%SZ'),
\r
150 + 'title': config['meta']['title'],
\r
151 + 'blurb': config['meta']['blurb'],
\r
152 + 'encoding': _ENCODING,
\r
153 + 'inter_message_padding': '0.25em',
\r
154 + 'border_radius': '0.5em',
\r
157 +_PAGES['text'] = Page()
\r
158 +_PAGES['html'] = HtmlPage(
\r
159 + header=header_template.format(**context),
\r
160 + footer=footer_template.format(**context),
\r
163 if args.list_views:
\r