From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/
Date: Sat, 9 Jul 2022 05:17:43 +0000 (UTC) [thread overview]
Message-ID: <1657343854.3851c6ea2fe93ee1d190adc13f3cfaef0901c982.sam@gentoo> (raw)
commit: 3851c6ea2fe93ee1d190adc13f3cfaef0901c982
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 9 05:17:34 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> 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 <sam <AT> 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)
next reply other threads:[~2022-07-09 5:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-09 5:17 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-03-07 18:49 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/equery/ Sam James
2024-03-07 18:49 Sam James
2023-09-19 19:13 Sam James
2023-08-05 5:38 Sam James
2023-07-18 22:30 Sam James
2023-07-18 22:26 Sam James
2022-07-28 15:29 Brian Dolbec
2022-07-28 15:29 Brian Dolbec
2022-07-10 18:41 Brian Dolbec
2022-07-10 18:01 Brian Dolbec
2022-07-10 16:23 Brian Dolbec
2022-07-10 16:23 Brian Dolbec
2022-07-10 1:24 Brian Dolbec
2018-05-01 12:32 Mike Pagano
2017-09-05 15:32 Mike Gilbert
2016-06-30 23:36 Paul Varner
2016-06-30 20:44 Paul Varner
2016-06-06 19:29 Brian Dolbec
2015-11-09 20:52 Brian Dolbec
2015-11-09 2:42 Brian Dolbec
2015-11-08 17:37 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1657343854.3851c6ea2fe93ee1d190adc13f3cfaef0901c982.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox