diff options
author | W. Trevor King <wking@tremily.us> | 2014-05-31 15:20:26 -0700 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2014-07-15 20:08:39 -0300 |
commit | f10024f30dc907d4396fb7ef3cc8541c89e31715 (patch) | |
tree | 87f7284cdc56705f0c2eacbf0a19be4d41a14e87 | |
parent | 783225846849b1f9c8f7ba3b54456278a2e46bc6 (diff) |
nmbug-status: Add the time to the footer's build-date
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
-rwxr-xr-x | devel/nmbug/nmbug-status | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index b7c2f80e..c0bdd1b6 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=''' <hr> -<p>Generated: {date} +<p>Generated: {datetime} </body> </html> '''.format(**context), |