[PATCH v2 08/20] nmbug-status: Consolidate HTML header printing
[notmuch-archives.git] / 53 / 9bef86a03736d8ec7ab4a74adf54be5181a3e4
diff --git a/53/9bef86a03736d8ec7ab4a74adf54be5181a3e4 b/53/9bef86a03736d8ec7ab4a74adf54be5181a3e4
new file mode 100644 (file)
index 0000000..eeeebc2
--- /dev/null
@@ -0,0 +1,106 @@
+Return-Path: <wking@tremily.us>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id F299B431FDD\r
+       for <notmuch@notmuchmail.org>; Mon, 10 Feb 2014 10:44:44 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 1gv90ey-uyoS for <notmuch@notmuchmail.org>;\r
+       Mon, 10 Feb 2014 10:44:38 -0800 (PST)\r
+Received: from qmta01.westchester.pa.mail.comcast.net\r
+       (qmta01.westchester.pa.mail.comcast.net [76.96.62.16])\r
+       by olra.theworths.org (Postfix) with ESMTP id 65C7E431FBD\r
+       for <notmuch@notmuchmail.org>; Mon, 10 Feb 2014 10:43:56 -0800 (PST)\r
+Received: from omta23.westchester.pa.mail.comcast.net ([76.96.62.74])\r
+       by qmta01.westchester.pa.mail.comcast.net with comcast\r
+       id Qho81n0051c6gX851ijw8j; Mon, 10 Feb 2014 18:43:56 +0000\r
+Received: from odin.tremily.us ([24.18.63.50])\r
+       by omta23.westchester.pa.mail.comcast.net with comcast\r
+       id Qihv1n00a152l3L3jihw9o; Mon, 10 Feb 2014 18:41:56 +0000\r
+Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
+       by odin.tremily.us (Postfix) with ESMTPS id 78CDA10167B1;\r
+       Mon, 10 Feb 2014 10:41:55 -0800 (PST)\r
+Received: (nullmailer pid 1260 invoked by uid 1000);\r
+       Mon, 10 Feb 2014 18:40:45 -0000\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 08/20] nmbug-status: Consolidate HTML header printing\r
+Date: Mon, 10 Feb 2014 10:40:29 -0800\r
+Message-Id:\r
+ <baedd516847f27bec29489eed3dc381dd076c01f.1392056624.git.wking@tremily.us>\r
+X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1\r
+In-Reply-To: <cover.1392056624.git.wking@tremily.us>\r
+References: <cover.1392056624.git.wking@tremily.us>\r
+In-Reply-To: <cover.1392056624.git.wking@tremily.us>\r
+References: <cover.1392056624.git.wking@tremily.us>\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+       s=q20121106; t=1392057836;\r
+       bh=A5pu3T/sSEWdI5VbSqgXNCMKF5j4y5sZerrdYMH7JY0=;\r
+       h=Received:Received:Received:Received:From:To:Subject:Date:\r
+       Message-Id;\r
+       b=ZIB7CPWyjOjE93+CyoTaNBEjL7Y2+UXH8hblxTLfkMkFqJS+tL6MhEJXExnQoYRj5\r
+       GvM14sM9ogu2i+iSwqjW7s5rdhP+8HY07d9Etw0rT1s+8zuaTO3rtu5zByFdgC0ZJS\r
+       9JdaaTX23zNNgjGf4Oz6bkPyEGyJBr2ZTAoUOVU8dADGY53/Nu8Yml/Avmz8plOoTm\r
+       fidtisUmIdZx/vZP6hdSZrRYGQEVs22hfxq1K4L7V3S2cu9YJ57kimAblV7Kaac1vE\r
+       WQHxHAdW+QTSov3NVllEjAW71zvM9UzwRplDF903vzjswQ10Ly4M4Ahrl47rvnoaIN\r
+       yHlmtxu7HliKg==\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 10 Feb 2014 18:44:45 -0000\r
+\r
+Make this all one big string, using '...{date}...'.format(date=...) to\r
+inject the date [1].  This syntax was added in Python 2.6, and is\r
+preferred to %-formatting in Python 3 [1].\r
+\r
+[1]: http://docs.python.org/2/library/stdtypes.html#str.format\r
+---\r
+ devel/nmbug/nmbug-status | 13 ++++++-------\r
+ 1 file changed, 6 insertions(+), 7 deletions(-)\r
+\r
+diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
+index be3e28e..3aa83b6 100755\r
+--- a/devel/nmbug/nmbug-status\r
++++ b/devel/nmbug/nmbug-status\r
+@@ -190,13 +190,12 @@ if output_format == 'html':\r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+ <title>Notmuch Patches</title>\r
+ </head>\r
+-<body>''')\r
+-    print('<h2>Notmuch Patches</h2>')\r
+-    print('Generated: %s<br />' % datetime.datetime.utcnow().date())\r
+-    print('For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a>')\r
+-\r
+-    print('<h3>Views</h3>')\r
+-    print('<ul>')\r
++<body>\r
++<h2>Notmuch Patches</h2>\r
++Generated: {date}<br />\r
++For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a>\r
++<h3>Views</h3>\r
++<ul>'''.format(date=datetime.datetime.utcnow().date()))\r
+     for view in config['views']:\r
+         print('<li><a href="#%(title)s">%(title)s</a></li>' % view)\r
+     print('</ul>')\r
+-- \r
+1.8.5.2.8.g0f6c0d1\r
+\r