From 855cdad6128c6ad07570ccecda4f0e490b1700bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 29 Sep 2020 11:39:50 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Slimmed=20down=20a=20metho?= =?UTF-8?q?d=20a=20bit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/plugin/core.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/octoprint/plugin/core.py b/src/octoprint/plugin/core.py index ab6ddbf18..a8bc23de0 100644 --- a/src/octoprint/plugin/core.py +++ b/src/octoprint/plugin/core.py @@ -368,15 +368,11 @@ class PluginInfo(object): object: The plugin's implementation if it matches all of the requested ``types``, None otherwise. """ - if not self.implementation: + if self.implementation and all(map(lambda t: isinstance(self.implementation, t), types)): + return self.implementation + else: return None - for t in types: - if not isinstance(self.implementation, t): - return None - - return self.implementation - @property def name(self): """