From 910a24a89f47471ba465d8c30c798a391552c7ab Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 24 Feb 2012 18:01:03 -0500 Subject: [PATCH] Minor updates. --- pages/earwigbot.mako | 4 ++-- pages/support/header.mako | 8 +++++++- static/css/main.css | 17 +++++++++-------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/pages/earwigbot.mako b/pages/earwigbot.mako index 1dfd5c7..86246f8 100644 --- a/pages/earwigbot.mako +++ b/pages/earwigbot.mako @@ -9,7 +9,7 @@ def format_date(d): start = datetime.strptime(d, "%a %b %d %H:%M:%S %Y") - since = start.strftime("%b %d, %Y at %H:%M:%S UTC") + since = start.strftime("%b %d, %Y %H:%M:%S UTC") diff = (datetime.utcnow() - start) if diff.days: uptime = "{0} days".format(diff.days) @@ -36,7 +36,7 @@ lines = result.splitlines()[1:] re_key = "^(.*?):\s" re_val = ":\s*(.*?)$" - data = dict((re.search(re_key, line).group(1), re.search(re_val, line).group(1)) for line in lines) + data = dict((re.search(re_key, line).group(1), re.search(re_val, line).group(1)) for line in lines if re.search(re_key, line) and re.search(re_val, line)) since, uptime = format_date(data["submission_time"]) host = data["sge_o_host"] return ["online", since, uptime, host] diff --git a/pages/support/header.mako b/pages/support/header.mako index ed0a88a..948aae2 100644 --- a/pages/support/header.mako +++ b/pages/support/header.mako @@ -1,4 +1,4 @@ -<%page args="environ, title, slug=None"/>\ +<%page args="environ, title, slug=None, add_css=(), add_js=()"/>\ <%namespace name="index" file="/index.mako" import="get_tools"/>\ <%! from itertools import count @@ -20,7 +20,13 @@ ${title} - earwig@toolserver + % for filename in add_css: + + % endfor + % for filename in add_js: + + % endfor