From 4b3f616eb43bc5cc60cadccd2779aa16d1115239 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 18 Sep 2013 09:43:03 -0500 Subject: [PATCH] Fix flake8 failures from pull/27 Fix a few formatting issues from within the previous pull request. Change-Id: Iadb0d5d4bfa1ac460c730e8af0cfec9386a4c066 --- stevedore/dispatch.py | 6 ++++-- stevedore/extension.py | 8 +++++--- stevedore/tests/test_dispatch.py | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/stevedore/dispatch.py b/stevedore/dispatch.py index 66c84cf..6536ee9 100644 --- a/stevedore/dispatch.py +++ b/stevedore/dispatch.py @@ -88,7 +88,8 @@ class DispatchExtensionManager(EnabledExtensionManager): .. versionadded:: 0.12 :param filter_func: Callable to test each extension. - :param method_name: The extension method name to call for each extension. + :param method_name: The extension method name to call + for each extension. :param args: Variable arguments to pass to method :param kwds: Keyword arguments to pass to method :returns: List of values returned from methods @@ -190,7 +191,8 @@ class NameDispatchExtensionManager(DispatchExtensionManager): .. versionadded:: 0.12 :param names: List or set of name(s) of extension(s) to invoke. - :param method_name: The extension method name to call for each extension. + :param method_name: The extension method name + to call for each extension. :param args: Variable arguments to pass to method :param kwds: Keyword arguments to pass to method :returns: List of values returned from methods diff --git a/stevedore/extension.py b/stevedore/extension.py index 66eb3f1..1ac87e8 100644 --- a/stevedore/extension.py +++ b/stevedore/extension.py @@ -145,7 +145,7 @@ class ExtensionManager(object): return getattr(extension.obj, method_name)(*args, **kwds) def map_method(self, method_name, *args, **kwds): - """Iterate over the extensions invoking each one's object method called `method_name`. + """Iterate over the extensions invoking a method by name. This is equivalent of using :meth:`map` with func set to `lambda x: x.obj.method_name()` @@ -157,12 +157,14 @@ class ExtensionManager(object): .. versionadded:: 0.12 - :param method_name: The extension method name to call for each extension. + :param method_name: The extension method name + to call for each extension. :param args: Variable arguments to pass to method :param kwds: Keyword arguments to pass to method :returns: List of values returned from methods """ - return self.map(self._call_extension_method, method_name, *args, **kwds) + return self.map(self._call_extension_method, + method_name, *args, **kwds) def _invoke_one_plugin(self, response_callback, func, e, args, kwds): try: diff --git a/stevedore/tests/test_dispatch.py b/stevedore/tests/test_dispatch.py index 76a66e2..7e1d8b0 100644 --- a/stevedore/tests/test_dispatch.py +++ b/stevedore/tests/test_dispatch.py @@ -88,6 +88,7 @@ def test_name_dispatch_ignore_missing(): expected = [('t1', ('first',), {'named': 'named value'})] assert results == expected + def test_name_dispatch_map_method(): em = dispatch.NameDispatchExtensionManager( 'stevedore.test.extension',