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 F1BBA158094 for ; Sat, 9 Jul 2022 05:17:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB15BE0BDB; Sat, 9 Jul 2022 05:17:46 +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 4C032E0BDB for ; Sat, 9 Jul 2022 05:17:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 288BB340E88 for ; Sat, 9 Jul 2022 05:17:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 62F78391 for ; Sat, 9 Jul 2022 05:17:43 +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: <1657343854.3851c6ea2fe93ee1d190adc13f3cfaef0901c982.sam@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/equery/depends.py X-VCS-Directories: pym/gentoolkit/equery/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 3851c6ea2fe93ee1d190adc13f3cfaef0901c982 X-VCS-Branch: master Date: Sat, 9 Jul 2022 05:17:43 +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: 2de568b7-aae9-4ff4-a7b8-cb9df9a868a0 X-Archives-Hash: 3539679a4d95fc1c84a2fb1c5d332c85 commit: 3851c6ea2fe93ee1d190adc13f3cfaef0901c982 Author: Sam James gentoo org> AuthorDate: Sat Jul 9 05:17:34 2022 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jul 9 05:17:34 2022 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=3851c6ea equery: run black Signed-off-by: Sam James gentoo.org> pym/gentoolkit/equery/depends.py | 47 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/pym/gentoolkit/equery/depends.py b/pym/gentoolkit/equery/depends.py index 93f0ec1..f65e846 100644 --- a/pym/gentoolkit/equery/depends.py +++ b/pym/gentoolkit/equery/depends.py @@ -19,6 +19,7 @@ from gentoolkit.equery import format_options, mod_usage, CONFIG from gentoolkit.helpers import get_cpvs, get_installed_cpvs from gentoolkit.cpv import CPV from gentoolkit.package import PackageFormatter, FORMAT_TMPL_VARS + # ======= # Globals # ======= @@ -69,18 +70,18 @@ class DependPrinter: if pkg is None: return - if CONFIG['verbose']: - print (PackageFormatter( - pkg, - do_format=True, - custom_format=QUERY_OPTS["package_format"] - )) + if CONFIG["verbose"]: + print( + PackageFormatter( + pkg, do_format=True, custom_format=QUERY_OPTS["package_format"] + ) + ) else: - print (PackageFormatter( - pkg, - do_format=False, - custom_format=QUERY_OPTS["package_format"] - )) + print( + PackageFormatter( + pkg, do_format=False, custom_format=QUERY_OPTS["package_format"] + ) + ) def format_depend(self, dep, dep_is_displayed): """Format a dependency for printing. @@ -107,24 +108,23 @@ class DependPrinter: use_conditional = " & ".join( pp.useflag(u) for u in mdep.use_conditional.split() ) - if mdep.operator == '=*': - formatted_dep = '=%s*' % str(mdep.cpv) + if mdep.operator == "=*": + formatted_dep = "=%s*" % str(mdep.cpv) else: formatted_dep = mdep.operator + str(mdep.cpv) if mdep.slot: - formatted_dep += pp.emph(':') + pp.slot(mdep.slot) + formatted_dep += pp.emph(":") + pp.slot(mdep.slot) if mdep.sub_slot: - formatted_dep += pp.slot('/') + pp.slot(mdep.sub_slot) + formatted_dep += pp.slot("/") + pp.slot(mdep.sub_slot) if mdep.use: - useflags = pp.useflag(','.join(mdep.use.tokens)) - formatted_dep += (pp.emph('[') + useflags + pp.emph(']')) + useflags = pp.useflag(",".join(mdep.use.tokens)) + formatted_dep += pp.emph("[") + useflags + pp.emph("]") if dep_is_displayed: indent = indent + " " * len(str(dep.cpv)) - self.print_fn(indent, '', use_conditional, formatted_dep) + self.print_fn(indent, "", use_conditional, formatted_dep) else: - self.print_fn(indent, \ - str(dep.cpv), use_conditional, formatted_dep) + self.print_fn(indent, str(dep.cpv), use_conditional, formatted_dep) # ========= @@ -174,7 +174,7 @@ def parse_module_options(module_opts): QUERY_OPTS["include_masked"] = True elif opt in ("-D", "--indirect"): QUERY_OPTS["only_direct"] = False - elif opt in ('-F', '--format'): + elif opt in ("-F", "--format"): QUERY_OPTS["package_format"] = posarg elif opt in ("--depth"): if posarg.isdigit(): @@ -190,9 +190,8 @@ def parse_module_options(module_opts): def main(input_args): """Parse input and run the program""" - short_opts = "hadDF:" # -d, --direct was old option for default action - long_opts = ('help', 'all-packages', 'direct', 'indirect', \ - 'format', 'depth=') + short_opts = "hadDF:" # -d, --direct was old option for default action + long_opts = ("help", "all-packages", "direct", "indirect", "format", "depth=") try: module_opts, queries = gnu_getopt(input_args, short_opts, long_opts)