[Patch v7 1/3] emacs: replace use of notmuch-address-message-insinuate
[notmuch-archives.git] / 03 / f48dc618062eaf0739b79c26171ede59b69291
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
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 0\r
11 X-Spam-Level: \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
14         autolearn=disabled\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
39 Message-Id:\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
50         Message-Id;\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
56         qgI5SoB4bkPBA==\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
60 Precedence: list\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
71 \r
72 For folks that don't like the default templates for whatever reason.\r
73 ---\r
74  NEWS                     | 18 ++++++++++++++++++\r
75  devel/nmbug/nmbug-status | 37 +++++++++++++++++++++----------------\r
76  2 files changed, 39 insertions(+), 16 deletions(-)\r
77 \r
78 diff --git a/NEWS b/NEWS\r
79 index 5d85733..ab6f9e4 100644\r
80 --- a/NEWS\r
81 +++ b/NEWS\r
82 @@ -1,3 +1,21 @@\r
83 +Notmuch 0.19 (UNRELEASED)\r
84 +=========================\r
85 +\r
86 +nmbug-status\r
87 +------------\r
88 +\r
89 +`nmbug-status` can now optionally load header and footer templates\r
90 +from the config file.  Use something like:\r
91 +\r
92 +    {\r
93 +      "meta": {\r
94 +        "header": "<!DOCTYPE html>\n<html lang="en">\n...",\r
95 +        "footer": "</body></html>",\r
96 +         ...\r
97 +      },\r
98 +      ...\r
99 +    },\r
100 +\r
101  Notmuch 0.18 (2014-05-06)\r
102  =========================\r
103  \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
110  \r
111  config = read_config(path=args.config)\r
112 -now = datetime.datetime.utcnow()\r
113 -context = {\r
114 -    'date': now,\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
121 -    }\r
122  \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
127  <html lang="en">\r
128  <head>\r
129    <meta http-equiv="Content-Type" content="text/html; charset={encoding}" />\r
130 @@ -338,13 +326,30 @@ _PAGES['html'] = HtmlPage(\r
131  {blurb}\r
132  </p>\r
133  <h3>Views</h3>\r
134 -'''.format(**context),\r
135 -    footer='''\r
136 +''')\r
137 +\r
138 +footer_template = config['meta'].get('footer', '''\r
139  <hr>\r
140  <p>Generated: {datetime}\r
141  </body>\r
142  </html>\r
143 -'''.format(**context),\r
144 +''')\r
145 +\r
146 +now = datetime.datetime.utcnow()\r
147 +context = {\r
148 +    'date': now,\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
155 +    }\r
156 +\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
161      )\r
162  \r
163  if args.list_views:\r
164 -- \r
165 1.9.1.353.gc66d89d\r
166 \r