From patchwork Mon Jul 8 08:14:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Huesca X-Patchwork-Id: 1128911 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45hysj73wbz9sNF for ; Mon, 8 Jul 2019 18:14:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 18E3D8734E; Mon, 8 Jul 2019 08:14:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mx9Z9rJGEcHW; Mon, 8 Jul 2019 08:14:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 4A6CE8733D; Mon, 8 Jul 2019 08:14:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id A4BFA1BF476 for ; Mon, 8 Jul 2019 08:14:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 97A92204EA for ; Mon, 8 Jul 2019 08:14:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MWhCKF7eeaJP for ; Mon, 8 Jul 2019 08:14:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by silver.osuosl.org (Postfix) with ESMTPS id 094912044C for ; Mon, 8 Jul 2019 08:14:23 +0000 (UTC) X-Originating-IP: 86.250.200.211 Received: from localhost.localdomain (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: victor.huesca@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id E48F01BF20A; Mon, 8 Jul 2019 08:14:15 +0000 (UTC) From: Victor Huesca To: buildroot@buildroot.org Date: Mon, 8 Jul 2019 10:14:04 +0200 Message-Id: <20190708081406.28215-3-victor.huesca@bootlin.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190708081406.28215-1-victor.huesca@bootlin.com> References: <20190708081406.28215-1-victor.huesca@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH buildroot-test 2/4] utils/daily-mail: allow to print a header for results section X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Victor Huesca , thomas@bootlin.com, antoine@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This table quite clear without header but as I had a template for the outdated table I also added the possibility to include one for results too. Note that this commit only add the option to print the header but does not enable it, so the existing behavior is preserved. Signed-off-by: Victor Huesca --- utils/daily-mail | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/utils/daily-mail b/utils/daily-mail index 4ab7710..b4d0a56 100755 --- a/utils/daily-mail +++ b/utils/daily-mail @@ -158,8 +158,25 @@ def add_outdated_pkg_notification(notifications, outdated_pkg): notif = get_notification_for_dev(notifications, get_orphan_developer()) notif.package_version_notification.append(pkg) -def show_results(results, show_status, show_orphan=False): + +def show_results(results, show_status, show_orphan=False, show_header=False): contents = "" + if show_header: + if show_status: + contents += '{:^12} | {:^30} | {:^3} | {:^79}'.format('arch', 'reason', 'OK?', 'url') + else: + contents += '{:^12} | {:^30} | {:^79}'.format('arch', 'reason', 'url') + if show_orphan: + contents += ' | {:^5}'.format('orph?') + + if show_status: + contents += '\n{0:-^12}-+-{0:-^30}-+-{0:-^3}-+-{0:-^79}-'.format('') + else: + contents += '\n{0:-^12}-+-{0:-^30}-+-{0:-^79}-'.format('') + if show_orphan: + contents += '+-{:-^5}-'.format('') + contents += '\n' + for r in results: arch = r['arch'] reason = r['reason']