instrukt.commands.command.CmdLog

class instrukt.commands.command.CmdLog(msg: ConsoleRenderable | RichCast | str)[source]

Bases: Message

Arbitrary log from a command execution.

Useful for commands with side effects who wish to also print some log.

Methods

__init__(msg)

can_replace(message)

Check if another message may supersede this one.

prevent_default([prevent])

Suppress the default action(s).

stop([stop])

Stop propagation of the message to parent.

Attributes

msg

ALLOW_SELECTOR_MATCH

Additional attributes that can be used with the [on decorator][textual.on].

bubble

control

The widget associated with this message, or None by default.

handler_name

Name of the default message handler.

is_forwarded

Has the message been forwarded?

namespace

no_dispatch

time

verbose

can_replace(message: Message) bool

Check if another message may supersede this one.

Parameters:

message – Another message.

Returns:

True if this message may replace the given message

prevent_default(prevent: bool = True) Message

Suppress the default action(s). This will prevent handlers in any base classes from being called.

Parameters:

prevent – True if the default action should be suppressed, or False if the default actions should be performed.

stop(stop: bool = True) Message

Stop propagation of the message to parent.

Parameters:

stop – The stop flag.

ALLOW_SELECTOR_MATCH: ClassVar[set[str]] = {}

Additional attributes that can be used with the [on decorator][textual.on].

These attributes must be widgets.

bubble: ClassVar[bool] = True
property control: Widget | None

The widget associated with this message, or None by default.

handler_name: ClassVar[str] = 'on_cmd_log'

Name of the default message handler.

property is_forwarded: bool

Has the message been forwarded?

msg
namespace: ClassVar[str] = 'instrukt'
no_dispatch: ClassVar[bool] = False
time
verbose: ClassVar[bool] = False