coder_plugin.base_plugin_handler

Base plugin handler for the coder_plugin system.

Defines a minimal plugin foundation that supports discovery, setup, execution, and context-managed resource handling.

Classes

BasePluginHandler(*args, **kwargs)

A basic plugin unit.

class coder_plugin.base_plugin_handler.BasePluginHandler(*args, **kwargs)[source]

Bases: BasePluginUnit

A basic plugin unit.

Provides a foundation for plugins that can be dynamically discovered and loaded via Python entry points. Supports runtime set up, execution, and context management.

__init__(*args, **kwargs)[source]

Initialize the plugin handler.

run(*args, **kwargs)[source]

Run the plugin handler’s main logic.

This method must be implemented by subclasses.

Parameters:
  • *args (Any) – Positional arguments for plugin’s run logic.

  • **kwargs (Any) – Keyword arguments for plugin’s run logic.

Returns:

The result of the plugin handler’s execution, as defined by the subclass.

Return type:

Any

Raises:

NotImplementedError – If not overridden by a subclass.

set_up(*args, **kwargs)[source]

Perform setup task(s) for this plugin.

This method should be overridden by subclasses to implement any required initialization logic before running the plugin.

Returns:

Enables fluent chaining after set up.

Return type:

Self