From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/ebuild/
Date: Fri, 21 Mar 2025 17:31:59 +0000 (UTC) [thread overview]
Message-ID: <1742578295.d7c5b9ee750f33b38ccfed478686130a9660b51d.arthurzam@gentoo> (raw)
commit: d7c5b9ee750f33b38ccfed478686130a9660b51d
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 21 11:12:39 2025 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 21 17:31:35 2025 +0000
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=d7c5b9ee
ebd_ipc: improve typing
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/pkgcore/ebuild/ebd_ipc.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/pkgcore/ebuild/ebd_ipc.py b/src/pkgcore/ebuild/ebd_ipc.py
index ea6b9b99..d836cc79 100644
--- a/src/pkgcore/ebuild/ebd_ipc.py
+++ b/src/pkgcore/ebuild/ebd_ipc.py
@@ -73,7 +73,7 @@ class IpcArgumentParser(arghparse.ArgumentParser):
def __init__(self, *args, **kwargs):
super().__init__(*args, suppress=True, add_help=False, **kwargs)
- def error(self, msg):
+ def error(self, msg: str):
raise IpcCommandError(msg)
@@ -81,18 +81,18 @@ class IpcCommand:
"""Commands sent from the bash side of the ebuild daemon to run."""
# argument parser for internal options
- parser = None
+ parser: IpcArgumentParser
# argument parser for command options/arguments
- arg_parser = None
+ arg_parser: IpcArgumentParser
# override IPC name for error messages
- name = None
+ name: str
def __init__(self, op):
self.op = op
self.pkg = op.pkg
self.eapi = op.pkg.eapi
self.observer = op.observer
- if self.name is None:
+ if not hasattr(self, "name"):
self.name = self.__class__.__name__.lower()
def __call__(self, ebd):
@@ -140,12 +140,12 @@ class IpcCommand:
def parse_args(self, options, args):
"""Parse internal args passed from the bash side."""
- if self.parser is not None:
+ if hasattr(self, "parser"):
_, unknown = self.parser.parse_known_args(options, namespace=self.opts)
if unknown:
raise UnknownOptions(unknown)
- if self.arg_parser is not None:
+ if hasattr(self, "arg_parser"):
# pull user options off the start of the argument list
_, args = self.arg_parser.parse_known_optionals(args, namespace=self.opts)
# parse remaining command arguments
@@ -690,7 +690,7 @@ class Dosym(_Symlink):
class Dohard(_Symlink):
- """Python wrapper for dosym."""
+ """Python wrapper for dohard."""
_link = os.link
@@ -842,8 +842,8 @@ class _AlterFiles(IpcCommand):
arg_parser.add_argument("-x", dest="excludes", action="store_true")
arg_parser.add_argument("targets", nargs="+")
- default_includes = ()
- default_excludes = ()
+ default_includes: tuple[str, ...] = ()
+ default_excludes: tuple[str, ...] = ()
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
next reply other threads:[~2025-03-21 17:32 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 17:31 Arthur Zamarin [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-03-21 19:52 [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/ebuild/ Arthur Zamarin
2024-06-13 16:40 Arthur Zamarin
2023-12-26 17:45 Arthur Zamarin
2023-10-23 17:35 Arthur Zamarin
2023-06-30 20:08 Arthur Zamarin
2023-02-04 19:52 Arthur Zamarin
2023-01-17 20:50 Arthur Zamarin
2023-01-03 18:06 Arthur Zamarin
2022-12-26 17:28 Arthur Zamarin
2022-12-26 17:28 Arthur Zamarin
2022-12-26 17:28 Arthur Zamarin
2022-12-26 17:28 Arthur Zamarin
2022-12-26 17:28 Arthur Zamarin
2022-12-26 17:28 Arthur Zamarin
2022-12-25 17:40 Arthur Zamarin
2022-12-22 7:11 Arthur Zamarin
2022-12-22 7:11 Arthur Zamarin
2022-12-22 7:11 Arthur Zamarin
2022-12-22 7:11 Arthur Zamarin
2022-12-22 7:11 Arthur Zamarin
2022-12-13 19:58 Arthur Zamarin
2022-11-26 11:17 Arthur Zamarin
2022-10-29 11:56 Arthur Zamarin
2022-10-16 16:38 Arthur Zamarin
2022-10-04 8:24 Arthur Zamarin
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=1742578295.d7c5b9ee750f33b38ccfed478686130a9660b51d.arthurzam@gentoo \
--to=arthurzam@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