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 F299B431FDD for ; Mon, 10 Feb 2014 10:44:44 -0800 (PST) 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 1gv90ey-uyoS for ; Mon, 10 Feb 2014 10:44:38 -0800 (PST) Received: from qmta01.westchester.pa.mail.comcast.net (qmta01.westchester.pa.mail.comcast.net [76.96.62.16]) by olra.theworths.org (Postfix) with ESMTP id 65C7E431FBD for ; Mon, 10 Feb 2014 10:43:56 -0800 (PST) Received: from omta23.westchester.pa.mail.comcast.net ([76.96.62.74]) by qmta01.westchester.pa.mail.comcast.net with comcast id Qho81n0051c6gX851ijw8j; Mon, 10 Feb 2014 18:43:56 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta23.westchester.pa.mail.comcast.net with comcast id Qihv1n00a152l3L3jihw9o; Mon, 10 Feb 2014 18:41:56 +0000 Received: from mjolnir.tremily.us (unknown [192.168.0.140]) by odin.tremily.us (Postfix) with ESMTPS id 78CDA10167B1; Mon, 10 Feb 2014 10:41:55 -0800 (PST) Received: (nullmailer pid 1260 invoked by uid 1000); Mon, 10 Feb 2014 18:40:45 -0000 From: "W. Trevor King" To: notmuch@notmuchmail.org Subject: [PATCH v2 08/20] nmbug-status: Consolidate HTML header printing Date: Mon, 10 Feb 2014 10:40:29 -0800 Message-Id: X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1392057836; bh=A5pu3T/sSEWdI5VbSqgXNCMKF5j4y5sZerrdYMH7JY0=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-Id; b=ZIB7CPWyjOjE93+CyoTaNBEjL7Y2+UXH8hblxTLfkMkFqJS+tL6MhEJXExnQoYRj5 GvM14sM9ogu2i+iSwqjW7s5rdhP+8HY07d9Etw0rT1s+8zuaTO3rtu5zByFdgC0ZJS 9JdaaTX23zNNgjGf4Oz6bkPyEGyJBr2ZTAoUOVU8dADGY53/Nu8Yml/Avmz8plOoTm fidtisUmIdZx/vZP6hdSZrRYGQEVs22hfxq1K4L7V3S2cu9YJ57kimAblV7Kaac1vE WQHxHAdW+QTSov3NVllEjAW71zvM9UzwRplDF903vzjswQ10Ly4M4Ahrl47rvnoaIN yHlmtxu7HliKg== 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: Mon, 10 Feb 2014 18:44:45 -0000 Make this all one big string, using '...{date}...'.format(date=...) to inject the date [1]. This syntax was added in Python 2.6, and is preferred to %-formatting in Python 3 [1]. [1]: http://docs.python.org/2/library/stdtypes.html#str.format --- devel/nmbug/nmbug-status | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index be3e28e..3aa83b6 100755 --- a/devel/nmbug/nmbug-status +++ b/devel/nmbug/nmbug-status @@ -190,13 +190,12 @@ if output_format == 'html': Notmuch Patches -''') - print('

Notmuch Patches

') - print('Generated: %s
' % datetime.datetime.utcnow().date()) - print('For more infomation see nmbug') - - print('

Views

') - print('
    ') + +

    Notmuch Patches

    +Generated: {date}
    +For more infomation see nmbug +

    Views

    +
      '''.format(date=datetime.datetime.utcnow().date())) for view in config['views']: print('
    • %(title)s
    • ' % view) print('
    ') -- 1.8.5.2.8.g0f6c0d1