From: W. Trevor King Date: Sat, 31 May 2014 22:20:26 +0000 (+1700) Subject: [PATCH v2 5/6] nmbug-status: Add the time to the footer's build-date X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dfa5fbb1d5871f67136d3a970c91064e2569febc;p=notmuch-archives.git [PATCH v2 5/6] nmbug-status: Add the time to the footer's build-date --- diff --git a/16/f4ed004165073674450d55dbc561746324b1ab b/16/f4ed004165073674450d55dbc561746324b1ab new file mode 100644 index 000000000..b29864254 --- /dev/null +++ b/16/f4ed004165073674450d55dbc561746324b1ab @@ -0,0 +1,115 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 2E087431FAE + for ; Sat, 31 May 2014 15:21:15 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id nz9VI0xGYrbC for ; + Sat, 31 May 2014 15:21:11 -0700 (PDT) +Received: from qmta04.westchester.pa.mail.comcast.net + (qmta04.westchester.pa.mail.comcast.net [76.96.62.40]) + by olra.theworths.org (Postfix) with ESMTP id 4C947431FD7 + for ; Sat, 31 May 2014 15:21:03 -0700 (PDT) +Received: from omta07.westchester.pa.mail.comcast.net ([76.96.62.59]) + by qmta04.westchester.pa.mail.comcast.net with comcast + id 8m4y1o0011GhbT854mM3zx; Sat, 31 May 2014 22:21:03 +0000 +Received: from odin.tremily.us ([24.18.63.50]) + by omta07.westchester.pa.mail.comcast.net with comcast + id 8mM11o00h152l3L3TmM214; Sat, 31 May 2014 22:21:03 +0000 +Received: from mjolnir.tremily.us (unknown [192.168.0.140]) + by odin.tremily.us (Postfix) with ESMTPS id C026411F065A; + Sat, 31 May 2014 15:21:00 -0700 (PDT) +Received: (nullmailer pid 13196 invoked by uid 1000); + Sat, 31 May 2014 22:20:38 -0000 +From: "W. Trevor King" +To: notmuch@notmuchmail.org +Subject: [PATCH v2 5/6] nmbug-status: Add the time to the footer's build-date +Date: Sat, 31 May 2014 15:20:26 -0700 +Message-Id: + <8d947211663ca195cfaaa9b2a22c87e1b26eab3d.1401574293.git.wking@tremily.us> +X-Mailer: git-send-email 1.9.1.353.gc66d89d +In-Reply-To: +References: +In-Reply-To: +References: +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; + s=q20140121; t=1401574863; + bh=SimABtxYl9jdaCjxLXz08Z0ZjeXLQsmCdwi6CcwIcaY=; + h=Received:Received:Received:Received:From:To:Subject:Date: + Message-Id; + b=PBLuseWDmCJPEobgjyj+SbKVbDJph4q4b5+O7SiCILVry9+fCOU68M4OHyIwwOOnt + 2fqXHDFB8FPAbuFzZzlE7hk03PFKknVzyrQPa0BM4cPOLZFgxFH9eQ3x8te3O0dFyT + QNP6KQ9ICdYwESdqeSk3D83qYSVqWZ3psrUCyCfxIQ4Cyms+1aSqsKmOCCze20wfzx + NUCphUKYQ467Edw16wD/wqYWiE3qfOQPpo8fIY19xG4kMK1wb12qkFAb04lRLjDb5b + 9ieOguwjvk9UwEmWuSWYeDFRRW+vFGQgvLrZmfhBf4EKRKGj5bubhbkNXScGW91Qc6 + bFMTAUCKUd5pg== +Cc: Tomi Ollila +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 31 May 2014 22:21:15 -0000 + +Our repository [1] has a post-update hook that rebuilds the status +page after each push. Since that may happen several times a day, we +might as well show the build time (as well as the date) in the footer. + +The trailing 'Z' is the ISO 8601 designator for UTC. Now that we're +showing times, it's nice to be explicit about the timezone we're +using. + +The rename from date -> datetime gives us backward-compatibility for +folks that *do* only want the date. We keep the old date formatting +to support those folks. + +[1]: http://nmbug.tethera.net/git/nmbug-tags.git +--- + devel/nmbug/nmbug-status | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status +index b7c2f80..c0bdd1b 100755 +--- a/devel/nmbug/nmbug-status ++++ b/devel/nmbug/nmbug-status +@@ -275,8 +275,10 @@ parser.add_argument('--get-query', help='get query for view', + args = parser.parse_args() + + config = read_config(path=args.config) ++now = datetime.datetime.utcnow() + context = { +- 'date': datetime.datetime.utcnow(), ++ 'date': now, ++ 'datetime': now.strftime('%Y-%m-%d %H:%M:%SZ'), + 'title': config['meta']['title'], + 'blurb': config['meta']['blurb'], + 'encoding': _ENCODING, +@@ -339,7 +341,7 @@ _PAGES['html'] = HtmlPage( + '''.format(**context), + footer=''' +
+-

Generated: {date} ++

Generated: {datetime} + + + '''.format(**context), +-- +1.9.1.353.gc66d89d +