Skip to content

sd_utils.plugins.plugin_collector

pencil-pusher edited this page Jul 15, 2021 · 3 revisions

Table of Contents

sd_utils.plugins.plugin_collector

collect_plugins

collect_plugins(registering_file: str, registering_file_name: str, cls: ClassVar[PluginBase] = PluginBase, exclude_files: List[str] = [], assert_one_per_source: bool = True) -> List[str]

collects all the plugins of a given type in the given directory then returns the list of plugins processed

Arguments:

  • registering_file str - should be __file__ of the calling file
  • registering_file_name str - should be __name__ of the calling file
  • cls ClassVar[PluginBase] - the type of plugin to collect
  • exclude_files List[str] - any file to exclude from being collected as a plugin
  • assert_one_per_source bool - asserts that only 1 plugin may be defined in each source file

Returns:

  • List[str] - a list of all the plugin files collected. should be stored in the calling files __all__ variable
Clone this wiki locally