run_command

async lsst.ts.m2gui.run_command(command, *args, is_prompted=True, **kwargs)

Run the command, which can be a normal function or a coroutine.

If the command fails and is_prompted is True, a dialog to warn the users will appear/pop up.

Parameters:
commandfunc or coroutine

Command to execute.

*argsargs

Arguments of the command.

is_promptedbool, optional

When False, dialog will not be executed. That is used for tests, which shall not be the case when used in the real GUI. (the default is True)

**kwargsdict, optional

Additional keyword arguments to run the command.

Returns:
bool

True if the command succeeds. Otherwise, False.