From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9D4D715808B for ; Mon, 4 Apr 2022 19:05:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 49632E088C; Mon, 4 Apr 2022 19:05:01 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BD4C8E088C for ; Mon, 4 Apr 2022 19:05:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C2A7834143C for ; Mon, 4 Apr 2022 19:04:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 26DAA38D for ; Mon, 4 Apr 2022 19:04:58 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1649099079.579092cb02fc15a7047c3c3c2c28d6aae6ea2aeb.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/manifest.py lib/portage/output.py X-VCS-Directories: lib/portage/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 579092cb02fc15a7047c3c3c2c28d6aae6ea2aeb X-VCS-Branch: master Date: Mon, 4 Apr 2022 19:04:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ea694a13-9cbd-4a07-a75a-868700ace591 X-Archives-Hash: bc7b00416270f196495c0d9d9bf03d6e commit: 579092cb02fc15a7047c3c3c2c28d6aae6ea2aeb Author: Kenneth Raplee kennethraplee com> AuthorDate: Sat Apr 2 01:23:49 2022 +0000 Commit: Sam James gentoo org> CommitDate: Mon Apr 4 19:04:39 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=579092cb Inline key-value insertions as dict expressions with key-value pairs Signed-off-by: Kenneth Raplee kennethraplee.com> Signed-off-by: Sam James gentoo.org> lib/portage/manifest.py | 3 +-- lib/portage/output.py | 58 ++++++++++++++++++++++++------------------------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/lib/portage/manifest.py b/lib/portage/manifest.py index f0fe1fbca..3555e08de 100644 --- a/lib/portage/manifest.py +++ b/lib/portage/manifest.py @@ -317,8 +317,7 @@ class Manifest: try: myentries = list(self._createManifestEntries()) update_manifest = True - preserved_stats = {} - preserved_stats[self.pkgdir.rstrip(os.sep)] = os.stat(self.pkgdir) + preserved_stats = {self.pkgdir.rstrip(os.sep): os.stat(self.pkgdir)} if myentries and not force: try: f = io.open( diff --git a/lib/portage/output.py b/lib/portage/output.py index e20046fc5..565f782ff 100644 --- a/lib/portage/output.py +++ b/lib/portage/output.py @@ -38,40 +38,38 @@ dotitles = 1 _styles = {} """Maps style class to tuple of attribute names.""" -codes = {} """Maps attribute name to ansi code.""" esc_seq = "\x1b[" -codes["normal"] = esc_seq + "0m" -codes["reset"] = esc_seq + "39;49;00m" - -codes["bold"] = esc_seq + "01m" -codes["faint"] = esc_seq + "02m" -codes["standout"] = esc_seq + "03m" -codes["underline"] = esc_seq + "04m" -codes["blink"] = esc_seq + "05m" -codes["overline"] = esc_seq + "06m" -codes["reverse"] = esc_seq + "07m" -codes["invisible"] = esc_seq + "08m" - -codes["no-attr"] = esc_seq + "22m" -codes["no-standout"] = esc_seq + "23m" -codes["no-underline"] = esc_seq + "24m" -codes["no-blink"] = esc_seq + "25m" -codes["no-overline"] = esc_seq + "26m" -codes["no-reverse"] = esc_seq + "27m" - -codes["bg_black"] = esc_seq + "40m" -codes["bg_darkred"] = esc_seq + "41m" -codes["bg_darkgreen"] = esc_seq + "42m" -codes["bg_brown"] = esc_seq + "43m" -codes["bg_darkblue"] = esc_seq + "44m" -codes["bg_purple"] = esc_seq + "45m" -codes["bg_teal"] = esc_seq + "46m" -codes["bg_lightgray"] = esc_seq + "47m" -codes["bg_default"] = esc_seq + "49m" -codes["bg_darkyellow"] = codes["bg_brown"] +codes = { + "normal": f"{esc_seq}0m", + "reset": f"{esc_seq}39;49;00m", + "bold": f"{esc_seq}01m", + "faint": f"{esc_seq}02m", + "standout": f"{esc_seq}03m", + "underline": f"{esc_seq}04m", + "blink": f"{esc_seq}05m", + "overline": f"{esc_seq}06m", + "reverse": f"{esc_seq}07m", + "invisible": f"{esc_seq}08m", + "no-attr": f"{esc_seq}22m", + "no-standout": f"{esc_seq}23m", + "no-underline": f"{esc_seq}24m", + "no-blink": f"{esc_seq}25m", + "no-overline": f"{esc_seq}26m", + "no-reverse": f"{esc_seq}27m", + "bg_black": f"{esc_seq}40m", + "bg_darkred": f"{esc_seq}41m", + "bg_darkgreen": f"{esc_seq}42m", + "bg_brown": f"{esc_seq}43m", + "bg_darkblue": f"{esc_seq}44m", + "bg_purple": f"{esc_seq}45m", + "bg_teal": f"{esc_seq}46m", + "bg_lightgray": f"{esc_seq}47m", + "bg_default": f"{esc_seq}49m", + "bg_darkyellow": f"{esc_seq}43m", +} def color(fg, bg="default", attr=["normal"]):