def get_plugin_list():
global _yaz_plugin_classes<EOL>def get_recursively(cls, plugin_list):<EOL><INDENT>for plugin in cls.__subclasses__():<EOL><INDENT>if not (plugin.yaz_is_final() or plugin.__qualname__ in _yaz_plugin_classes):<EOL><INDENT>plugin_list[plugin.__qualname__].append(plugin)<EOL><DEDENT>get_recursively(plugin, plugin_list)<EOL><DEDENT>return plugin_list<EOL><DEDENT>def include_class(candidate, classes):<EOL><INDENT>for cls in classes:<EOL><INDENT>if candidate is cls:<EOL><INDENT>continue<EOL><DEDENT>if issubclass(cls, candidate):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL><DEDENT>def get_plugin_type(qualname, plugins):<EOL><INDENT>classes = sorted(plugins, key=lambda plugin: plugin.yaz_get_ordinal())<EOL>classes = [cls for cls in classes if include_class(cls, classes)]<EOL>logger.debug("<STR_LIT>", qualname, [cls for cls in classes])<EOL>return type(qualname, tuple(classes) + (Final,), {})<EOL><DEDENT>logger.debug("<STR_LIT>" % _yaz_plugin_classes)<EOL>plugin_list = get_recursively(BasePlugin, collections.defaultdict(list))<EOL>_yaz_plugin_classes.update((qualname, get_plugin_type(qualname, plugins))<EOL>for qualname, plugins<EOL>in plugin_list.items())<EOL>assert isinstance(_yaz_plugin_classes, dict), type(_yaz_plugin_classes)<EOL>assert all(isinstance(qualname, str) for qualname in _yaz_plugin_classes.keys()), "<STR_LIT>"<EOL>assert all(issubclass(plugin_class, Final) for plugin_class in _yaz_plugin_classes.values()), "<STR_LIT>"<EOL>return _yaz_plugin_classes<EOL>
Finds all yaz plugins and returns them in a __qualname__: plugin_class dictionary