diff options
author | Brian Harring <ferringb@gmail.com> | 2023-01-16 22:13:25 -0800 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2023-02-05 20:08:21 +0200 |
commit | 83419e5421f5e892fc0964bd5825f3454e6a04df (patch) | |
tree | e2905eb00bae9bc482f3c2742328fb45c3b60682 | |
parent | refactor(config): drop duplicated add_config_source methods. (diff) | |
download | pkgcore-83419e5421f5e892fc0964bd5825f3454e6a04df.tar.gz pkgcore-83419e5421f5e892fc0964bd5825f3454e6a04df.tar.bz2 pkgcore-83419e5421f5e892fc0964bd5825f3454e6a04df.zip |
refactor(config): remove indirection of multiplex.config_tree for multiplex.tree
config_tree was added before config hints were a thing; instead just annotate the
class directly.
Signed-off-by: Brian Harring <ferringb@gmail.com>
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r-- | src/pkgcore/ebuild/portage_conf.py | 2 | ||||
-rw-r--r-- | src/pkgcore/repository/multiplex.py | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/pkgcore/ebuild/portage_conf.py b/src/pkgcore/ebuild/portage_conf.py index ef25baab3..d33d2e37d 100644 --- a/src/pkgcore/ebuild/portage_conf.py +++ b/src/pkgcore/ebuild/portage_conf.py @@ -216,7 +216,7 @@ class PortageConfig(DictMixin): self["repo-stack"] = basics.FakeIncrementalDictConfigSection( my_convert_hybrid, { - "class": "pkgcore.repository.multiplex.config_tree", + "class": "pkgcore.repository.multiplex.tree", "repos": tuple(repos), }, ) diff --git a/src/pkgcore/repository/multiplex.py b/src/pkgcore/repository/multiplex.py index d4dcf206a..e46799939 100644 --- a/src/pkgcore/repository/multiplex.py +++ b/src/pkgcore/repository/multiplex.py @@ -14,7 +14,7 @@ from snakeoil.compatibility import sorted_cmp from snakeoil.currying import post_curry from snakeoil.iterables import iter_sort -from ..config.hint import configurable +from ..config.hint import ConfigHint from ..operations import repo as repo_interface from . import errors, prototype @@ -62,11 +62,6 @@ class operations(repo_interface.operations_proxy): return ret -@configurable(types={"repos": "refs:repo"}, typename="repo") -def config_tree(repos): - return tree(*repos) - - class tree(prototype.tree): """Repository combining multiple repos together. @@ -84,6 +79,8 @@ class tree(prototype.tree): frozen_settable = False operations_kls = operations + pkgcore_config_type = ConfigHint(types={"repos": "refs:repo"}, typename="repo") + def __init__(self, *trees): super().__init__() for x in trees: |