Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.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 smtp.lore.kernel.org (Postfix) with ESMTPS id ACEA9C19F2D for ; Sat, 6 Aug 2022 21:56:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 4DC5E40117; Sat, 6 Aug 2022 21:56:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4DC5E40117 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tOltNmc6LATo; Sat, 6 Aug 2022 21:56:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 25CF44015D; Sat, 6 Aug 2022 21:56:51 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 25CF44015D Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 345B51BF3FF for ; Sat, 6 Aug 2022 21:56:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0F4FA60F84 for ; Sat, 6 Aug 2022 21:56:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0F4FA60F84 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hmrTum4gE78C for ; Sat, 6 Aug 2022 21:56:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 4491E60BA9 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by smtp3.osuosl.org (Postfix) with ESMTPS id 4491E60BA9 for ; Sat, 6 Aug 2022 21:56:47 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id E0CCD1C0003; Sat, 6 Aug 2022 21:56:43 +0000 (UTC) To: buildroot@buildroot.org Date: Sat, 6 Aug 2022 23:56:40 +0200 Message-Id: <20220806215641.471770-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1659823004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=z0yR+8S0FY6U+ke6dHkKICTwcFdjBdQBK/r8VI+wh+A=; b=EMUsSRduHKhZ98GUGqVb2rd1QpoRipXc2LsLt23wivToXz/yN7m4KuDOzhRiQPHoB6R4MR Gi943FgeUachKhsqAghBFyWhjbth0hjt4v0PuwpsShrAT/CTkjZGiw/k56S/tkPwVUVWg2 DNy3xDmLiYarOwpR8UXByhKCrDO0p34sW6FtjHC7ujSAsl3S5EPJVgD5Nf0IkA6wN+T5U7 cdN6vZPxgo5PGJHeb/xUM5Av2FSkJlMyunt9AU1HM1GZgx3YTtjK2fY7qh8gJx9oDUUmlq BFDDyPPJ1mqSVxg4V6CvnN9onvEuhwqlsHe043Av1zvjnV1nXFQnVnu7BnceuQ== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=EMUsSRdu Subject: [Buildroot] [PATCH 1/2] support/scripts/pkg-stats: remove useless escaping of double quotes X-BeenThere: buildroot@buildroot.org 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: , From: Thomas Petazzoni via buildroot Reply-To: Thomas Petazzoni Cc: Sen Hastings , Thomas Petazzoni Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Within single-quoted f-strings, and within triple double quoted strings, escaping all the double quotes is completely useless and makes the code more difficult to read. Get rid of all this useless escaping. The renderer HTML is exactly identical before/after this commit. Signed-off-by: Thomas Petazzoni --- support/scripts/pkg-stats | 100 +++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats index d32abd7225..572757b7ea 100755 --- a/support/scripts/pkg-stats +++ b/support/scripts/pkg-stats @@ -886,7 +886,7 @@ function expandField(fieldId){ -Results
+Results
""" # noqa - tabs and spaces @@ -920,8 +920,8 @@ def boolean_str(b): def dump_html_pkg(f, pkg): pkg_css_class = pkg.path.replace("/", "_")[:-3] - f.write(f'
{pkg.path}
\n') + f.write(f'
{pkg.path}
\n') # Patch count data_field_id = f'patch_count__{pkg_css_class}' div_class = ["centered patch_count data"] @@ -932,8 +932,8 @@ def dump_html_pkg(f, pkg): div_class.append("somepatches") else: div_class.append("lotsofpatches") - f.write(f'
{str(pkg.patch_count)}
\n') + f.write(f'
{str(pkg.patch_count)}
\n') # Infrastructure data_field_id = f'infrastructure__{pkg_css_class}' @@ -944,8 +944,8 @@ def dump_html_pkg(f, pkg): div_class.append("wrong") else: div_class.append("correct") - f.write(f'
{infra_str(pkg.infras)}
\n') + f.write(f'
{infra_str(pkg.infras)}
\n') # License data_field_id = f'license__{pkg_css_class}' @@ -955,8 +955,8 @@ def dump_html_pkg(f, pkg): div_class.append("correct") else: div_class.append("wrong") - f.write(f'
{boolean_str(pkg.is_status_ok("license"))}
\n') + f.write(f'
{boolean_str(pkg.is_status_ok("license"))}
\n') # License files data_field_id = f'license_files__{pkg_css_class}' @@ -966,8 +966,8 @@ def dump_html_pkg(f, pkg): div_class.append("correct") else: div_class.append("wrong") - f.write(f'
{boolean_str(pkg.is_status_ok("license-files"))}
\n') + f.write(f'
{boolean_str(pkg.is_status_ok("license-files"))}
\n') # Hash data_field_id = f'hash_file__{pkg_css_class}' @@ -977,8 +977,8 @@ def dump_html_pkg(f, pkg): div_class.append("correct") else: div_class.append("wrong") - f.write(f'
{boolean_str(pkg.is_status_ok("hash"))}
\n') + f.write(f'
{boolean_str(pkg.is_status_ok("hash"))}
\n') # Current version data_field_id = f'current_version__{pkg_css_class}' @@ -986,8 +986,8 @@ def dump_html_pkg(f, pkg): current_version = pkg.current_version[:20] + "..." else: current_version = pkg.current_version - f.write(f'
{current_version}
\n') + f.write(f'
{current_version}
\n') # Latest version data_field_id = f'latest_version__{pkg_css_class}' @@ -1020,7 +1020,7 @@ def dump_html_pkg(f, pkg): else: latest_version_text += "found by guess" - f.write(f'
{latest_version_text}
\n') + f.write(f'
{latest_version_text}
\n') # Warnings data_field_id = f'warnings__{pkg_css_class}' @@ -1030,7 +1030,7 @@ def dump_html_pkg(f, pkg): div_class.append("correct") else: div_class.append("wrong") - f.write(f'
{pkg.warnings}
\n') + f.write(f'
{pkg.warnings}
\n') # URL status data_field_id = f'upstream_url__{pkg_css_class}' @@ -1045,7 +1045,7 @@ def dump_html_pkg(f, pkg): else: div_class.append("good_url") url_str = "Link" % pkg.url - f.write(f'
{url_str}
\n') + f.write(f'
{url_str}
\n') # CVEs data_field_id = f'cves__{pkg_css_class}' @@ -1061,11 +1061,11 @@ def dump_html_pkg(f, pkg): div_class.append("cve-ok") else: div_class.append("cve-unknown") - f.write(f'
\n') + f.write(f'
\n') if len(pkg.cves) > 10: cve_total = len(pkg.cves) + 1 - f.write(f'
see all ({cve_total}) ▾
\n') + f.write(f'
see all ({cve_total}) ▾
\n') if pkg.is_status_error("cve"): for cve in pkg.cves: f.write(" %s
\n" % (cve, cve)) @@ -1083,7 +1083,7 @@ def dump_html_pkg(f, pkg): div_class.append(f'_{pkg_css_class}') if pkg.ignored_cves: div_class.append("cve_ignored") - f.write(f'
\n') + f.write(f'
\n') for ignored_cve in pkg.ignored_cves: f.write(" %s
\n" % (ignored_cve, ignored_cve)) f.write("
\n") @@ -1100,7 +1100,7 @@ def dump_html_pkg(f, pkg): div_class.append("cpe-ok") else: div_class.append("cpe-unknown") - f.write(f'
\n') + f.write(f'
\n') if pkg.cpeid: cpeid_begin = ":".join(pkg.cpeid.split(":")[0:4]) + ":" cpeid_formatted = pkg.cpeid.replace(cpeid_begin, cpeid_begin + "") @@ -1121,33 +1121,33 @@ def dump_html_pkg(f, pkg): def dump_html_all_pkgs(f, packages): f.write(""" -
-
Package
-
Patch count
-
Infrastructure
-
License
-
License files
-
Hash file
-
Current version
-
Latest version
-
Warnings
-
Upstream URL
-
CVEs
-
CVEs Ignored
-
CPE ID
+
+
Package
+
Patch count
+
Infrastructure
+
License
+
License files
+
Hash file
+
Current version
+
Latest version
+
Warnings
+
Upstream URL
+
CVEs
+
CVEs Ignored
+
CPE ID
""") for pkg in sorted(packages): dump_html_pkg(f, pkg) -- 2.37.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot