Skip to content

Commit

Permalink
DOC Add doc in CommandRegistry about when it is updated (#316)
Browse files Browse the repository at this point in the history
Adds some info about when `CommandRegistry` is updated. Uses info
learned when debugging #314

Happy to change wording or move to a better place.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>
Co-authored-by: Nathan Clack <nclack@chanzuckerberg.com>
  • Loading branch information
4 people authored Oct 13, 2023
1 parent cb5ba4a commit fad71d8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/npe2/_command_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ def resolve(self) -> Callable:


class CommandRegistry:
"""Registry of commands, updated on `PluginManager.activate`.
`PluginManager.activate` is only run on `CommandRegistry.get` (when we resolve the
callable object for a command). This means that commands from enabled plugins are
not added to `CommandRegistry` until a command from that plugin is executed.
"""

command_registered = Signal(str)
command_unregistered = Signal(str)

Expand Down

0 comments on commit fad71d8

Please sign in to comment.