From d4de7996e6d4fb5db04dfed3b3fd12747622b164 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 23 Dec 2008 17:33:37 -0500 Subject: Use my lazr.config megamerge branch for now, even though it's still under development. Completely rework the way switchboards and queue runners are initialized, i.e. driven from the configuration file instead of hard coded. The various queue runner directories are no longer available thorugh the config object directly. Get them from config.switchboards. Provide minimal mailman.cfg and testing.cfg configuration files. Neuter styles for now until they can be consolidated with lazr.config. --- mailman/testing/helpers.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mailman/testing/helpers.py') diff --git a/mailman/testing/helpers.py b/mailman/testing/helpers.py index 0f9c3edae..2f5b4af01 100644 --- a/mailman/testing/helpers.py +++ b/mailman/testing/helpers.py @@ -58,14 +58,19 @@ def make_testable_runner(runner_class): :return: A runner instance. """ + assert runner_class.__name__.endswith('Runner'), ( + 'Unparseable runner class name: %s' % runner_class.__name__) + + name = runner_class.__name__[:-6].lower() + class EmptyingRunner(runner_class): """Stop processing when the queue is empty.""" def _do_periodic(self): """Stop when the queue is empty.""" - self._stop = (len(self._switchboard.files) == 0) + self._stop = (len(self.switchboard.files) == 0) - return EmptyingRunner() + return EmptyingRunner(name) -- cgit v1.2.3-70-g09d2