schrodinger.maestro.command_feedback module

Collect structured feedback during synchronous Maestro commands.

The active collector is temporarily installed as a QApplication property so native command implementations can publish feedback without depending on the Python caller.

class schrodinger.maestro.command_feedback.CommandFeedback

Bases: QObject

Collect structured feedback produced by one Maestro command call.

Feedback is stored by key for conversion to the dictionary returned by schrodinger.maestro.command when rich_return=True.

__init__() → None

Constructor.

addFeedback(key: str, value: Any) → None

Store a feedback value under key.

Parameters:
  • key – Dictionary key under which to store the feedback.

  • value – JSON-serializable feedback value.

getFeedback() → dict[str, Any]

Return the collected feedback as a dictionary.

Returns:

A defensive copy of the values collected for this command.

schrodinger.maestro.command_feedback.command_feedback_context(feedback: CommandFeedback) → Iterator[None]

Install a collector for the duration of one command invocation under the COMMAND_FEEDBACK_PROPERTY on the QApplication instance. COMMAND_FEEDBACK_PROPERTY is set to None on exit.

Parameters:

feedback – Collector to expose to native command implementations.