From 89ccfae919d6ff4578531aff028163ee0ae003c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 4 Sep 2015 15:54:48 +0200 Subject: [PATCH] Fixed get_filtered_implementation again Apparently, *args and named but optional arguments in combination are more tricky to get right than they first appear. --- src/octoprint/plugin/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/octoprint/plugin/core.py b/src/octoprint/plugin/core.py index 57771ac6..5226dec8 100644 --- a/src/octoprint/plugin/core.py +++ b/src/octoprint/plugin/core.py @@ -1083,7 +1083,7 @@ class PluginManager(object): return [impl[1] for impl in sorted(result, key=sort_func)] - def get_filtered_implementations(self, f, sorting_context=None, *types): + def get_filtered_implementations(self, f, *types, **kwargs): """ Get all mixin implementation that implementat *all* of the provided ``types`` and match the provided filter `f`. @@ -1096,7 +1096,7 @@ class PluginManager(object): """ assert callable(f) - implementations = self.get_implementations(*types, sorting_context=sorting_context) + implementations = self.get_implementations(*types, sorting_context=kwargs.get("sorting_context", None)) return filter(f, implementations) def get_helpers(self, name, *helpers):