diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2023-07-15 11:18:03 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2023-07-15 11:18:03 +0300 |
commit | a28c4971887aa774f5f589662646da8f6dcb7c4e (patch) | |
tree | 5e52444e26c168faa985b5e17320a9acd77961e1 | |
parent | Revert "multiplex.tree: fix config name and type" (diff) | |
download | pkgcore-a28c4971887aa774f5f589662646da8f6dcb7c4e.tar.gz pkgcore-a28c4971887aa774f5f589662646da8f6dcb7c4e.tar.bz2 pkgcore-a28c4971887aa774f5f589662646da8f6dcb7c4e.zip |
multiplex.tree: fix config name and type
Resolves: https://github.com/pkgcore/pkgcheck/issues/602
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r-- | src/pkgcore/pkgsets/live_rebuild_set.py | 2 | ||||
-rw-r--r-- | src/pkgcore/repository/multiplex.py | 16 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/pkgcore/pkgsets/live_rebuild_set.py b/src/pkgcore/pkgsets/live_rebuild_set.py index baa2d93f..7a864720 100644 --- a/src/pkgcore/pkgsets/live_rebuild_set.py +++ b/src/pkgcore/pkgsets/live_rebuild_set.py @@ -25,7 +25,7 @@ class EclassConsumerSet(VersionedInstalled): if not pkgs: # pkg is installed but no longer in any repo, just ignore it. continue - assert len(pkgs) == 1, "I do not know what I am doing: %r" % (pkgs,) + assert len(pkgs) == 1, f"I do not know what I am doing: {pkgs}" pkg = pkgs[0] if self.eclasses.isdisjoint(pkg.data.get("_eclasses_", ())): yield atom diff --git a/src/pkgcore/repository/multiplex.py b/src/pkgcore/repository/multiplex.py index e4679993..f56dfb0e 100644 --- a/src/pkgcore/repository/multiplex.py +++ b/src/pkgcore/repository/multiplex.py @@ -81,8 +81,9 @@ class tree(prototype.tree): pkgcore_config_type = ConfigHint(types={"repos": "refs:repo"}, typename="repo") - def __init__(self, *trees): + def __init__(self, *trees, repos=()): super().__init__() + trees = trees + tuple(repos) for x in trees: if not hasattr(x, "itermatch"): raise errors.InitializationError( @@ -229,8 +230,7 @@ class tree(prototype.tree): elif isinstance(other, tree): return tree(*(self.trees + other.trees)) raise TypeError( - "cannot add '%s' and '%s' objects" - % (self.__class__.__name__, other.__class__.__name__) + f"cannot add {other.__class__.__name__!r} and {self.__class__.__name__!r} objects" ) def __radd__(self, other): @@ -241,17 +241,11 @@ class tree(prototype.tree): elif isinstance(other, tree): return tree(*(other.trees + self.trees)) raise TypeError( - "cannot add '%s' and '%s' objects" - % (other.__class__.__name__, self.__class__.__name__) + f"cannot add {other.__class__.__name__!r} and {self.__class__.__name__!r} objects" ) def __repr__(self): - return "<%s.%s trees=%r @%#8x>" % ( - self.__class__.__module__, - self.__class__.__name__, - getattr(self, "trees", "unset"), - id(self), - ) + return f"<{self.__class__.__module__}.{self.__class__.__name__} trees={getattr(self, 'trees', 'unset')!r} @{id(self):#8x}>" @property def pkg_masks(self): |