From: W. Trevor King Date: Mon, 3 Feb 2014 10:59:26 +0000 (+1600) Subject: [PATCH 08/17] nmbug-status: Consolidate HTML header printing X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=952e543c4f591990cc0f25fa83f15baf48faef71;p=notmuch-archives.git [PATCH 08/17] nmbug-status: Consolidate HTML header printing --- diff --git a/3c/c96c37dbb89f62a9baf95d3bbddc820647e181 b/3c/c96c37dbb89f62a9baf95d3bbddc820647e181 new file mode 100644 index 000000000..46060b5b9 --- /dev/null +++ b/3c/c96c37dbb89f62a9baf95d3bbddc820647e181 @@ -0,0 +1,105 @@ +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 C4F62429E3B + for ; Mon, 3 Feb 2014 03:02:58 -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 rCjrKQ1Sz6qj for ; + Mon, 3 Feb 2014 03:02:51 -0800 (PST) +Received: from qmta15.westchester.pa.mail.comcast.net + (qmta15.westchester.pa.mail.comcast.net [76.96.59.228]) + by olra.theworths.org (Postfix) with ESMTP id 52AEC429E2F + for ; Mon, 3 Feb 2014 03:02:42 -0800 (PST) +Received: from omta01.westchester.pa.mail.comcast.net ([76.96.62.11]) + by qmta15.westchester.pa.mail.comcast.net with comcast + id Mmzo1n0080EZKEL5Fn2i3H; Mon, 03 Feb 2014 11:02:42 +0000 +Received: from odin.tremily.us ([24.18.63.50]) + by omta01.westchester.pa.mail.comcast.net with comcast + id Mn0h1n006152l3L3Mn0iiU; Mon, 03 Feb 2014 11:00:42 +0000 +Received: from mjolnir.tremily.us (unknown [192.168.0.140]) + by odin.tremily.us (Postfix) with ESMTPS id 184D8FB4D50; + Mon, 3 Feb 2014 03:00:41 -0800 (PST) +Received: (nullmailer pid 694 invoked by uid 1000); + Mon, 03 Feb 2014 10:59:41 -0000 +From: "W. Trevor King" +To: notmuch@notmuchmail.org +Subject: [PATCH 08/17] nmbug-status: Consolidate HTML header printing +Date: Mon, 3 Feb 2014 02:59:26 -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=1391425362; + bh=A5pu3T/sSEWdI5VbSqgXNCMKF5j4y5sZerrdYMH7JY0=; + h=Received:Received:Received:Received:From:To:Subject:Date: + Message-Id; + b=dIsED72NAObM/km8PkR3Tu0F2MQwwESoSqqGUcMY2gaoGN1Nyyl/sfjZ08H+R/KC3 + 2FJllf/c5xVJQSzfw9tI1HtPpmfjL6uGzW290biltEqyiYM596q+HW5mk7Sbq+OQxS + 5lqpya2IVHPkStHpVTFIUs1lyE+qJMk+8Z5iVnN1XHwaFy1sRCCz+8tuCl4zB8B0P5 + Hc+ggbVu83fEyuhrFTvye3foU8/zQ0/hoTLrt1h67KSo73c3NJ6GsbvAWSdJmAFakm + Unr5J5Scl36pZcADGI6NsVTDIh4i6ignjYOUkPZRmplVXF9qeTNTxPbcp6Xd55tXsV + 3uLJJAyvDRcYQ== +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, 03 Feb 2014 11:02:59 -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 +