From e5e79c093c50bfaf7ec667fe0ded72efe972d1c3 Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Tue, 10 Jan 2023 01:42:00 -0800 Subject: refactor(sync): hide FD passing as an internal thing. Effectively, add '_spawn' and '_spawn_interactive' to the base class, and expect consumers to invoke the appropriate one. This addition doesn't fully fix the fundamental lack of an observer (or log) based approach to getting info out of syncers, but it at least hides some of the internals so the syncer classes can do things like knowing what the correct encoding is for stdout, thus being able to write their own messages to it. TL;DR: This subsystem's interaction w/ CLI (and used as a library) needs rewriting, this just reduces that problem when we visit it. Signed-off-by: Brian Harring Signed-off-by: Arthur Zamarin --- tests/scripts/test_pmaint.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/scripts/test_pmaint.py b/tests/scripts/test_pmaint.py index 63846456d..c9af122f2 100644 --- a/tests/scripts/test_pmaint.py +++ b/tests/scripts/test_pmaint.py @@ -1,6 +1,9 @@ from functools import partial from io import BytesIO +from snakeoil.formatters import PlainTextFormatter +from snakeoil.mappings import AttrAccessible + from pkgcore.config import basics from pkgcore.config.hint import ConfigHint from pkgcore.ebuild.cpv import CPV @@ -9,8 +12,6 @@ from pkgcore.repository import syncable, util from pkgcore.scripts import pmaint from pkgcore.sync import base from pkgcore.test.scripts.helpers import ArgParseMixin -from snakeoil.formatters import PlainTextFormatter -from snakeoil.mappings import AttrAccessible Options = AttrAccessible @@ -96,7 +97,7 @@ class FakeSyncer(base.Syncer): super().__init__(*args, **kwargs) self.synced = False - def _sync(self, verbosity, output_fd, **kwds): + def _sync(self, verbosity, **kwds): self.synced = True return self.succeed -- cgit v1.2.3-65-gdbad