conntextual.ui
index
/home/vkottler/src/vkottler/workspace/conntextual/conntextual/ui/__init__.py

A module implementing a basic user interface.

 
Package Contents
       
base
channel (package)
footer
model
task

 
Classes
       
enum.StrEnum(builtins.str, enum.ReprEnum)
conntextual.ui.channel.model.ChannelEnvironmentSource
textual.app.App(typing.Generic, textual.dom.DOMNode)
conntextual.ui.base.Base
textual.widgets._static.Static(textual.widget.Widget)
conntextual.ui.channel.environment.ChannelEnvironmentDisplay

 
class Base(textual.app.App)
    Base(driver_class: 'Type[Driver] | None' = None, css_path: 'CSSPathType | None' = None, watch_css: 'bool' = False)
 
A simple textual application.
 
 
Method resolution order:
Base
textual.app.App
typing.Generic
textual.dom.DOMNode
textual.message_pump.MessagePump
builtins.object

Methods defined here:
async action_quit(self) -> None
Stop the rest of the application when quitting.
action_random_channel(self) -> None
Randomize the channel on the current tab.
action_refresh_plot(self) -> None
Refresh the current plot.
action_tab(self, forward: bool) -> None
Change the active tab.
action_toggle_pause(self) -> None
Toggle pause state.
compose(self) -> Iterable[textual.widget.Widget]
Create child nodes.
compose_app(self) -> Iterable[textual.widget.Widget]
Application-specific interface creation.
dispatch(self, max_plot_samples: int, update_table: bool = True, update_log: bool = True, update_plot: bool = True) -> None
Update channel values.
ui_enabled(self, name: str) -> bool
Determine if a task tab should be created for a task with a given name.

Static methods defined here:
create(app: runtimepy.net.arbiter.info.AppInfo, env: runtimepy.channel.environment.ChannelEnvironment, handle_debug: bool = True) -> 'Base'
Create an application instance.

Readonly properties defined here:
current_channel_environment
Get the current channel-environment display.
tabs
Get the tab container.

Data and other attributes defined here:
BINDINGS = [('q', 'quit'), (<Keys.Escape: 'escape'>, 'quit', '(or q) quit'), ('space', 'toggle_pause', 'toggle pause'), ('d', 'toggle_dark', 'toggle dark mode'), ('g', 'screenshot', 'take a screenshot'), ('r', 'refresh_plot', 'refresh plot'), ('R', 'random_channel', 'plot random channel'), Binding(key=<Keys.Tab: 'tab'>, action='tab(True)...tab', show=True, key_display=None, priority=True), Binding(key=<Keys.BackTab: 'shift+tab'>, action=...tab', show=True, key_display=None, priority=True)]
CSS_PATH = PosixPath('/home/vkottler/src/vkottler/workspace/conntextual/conntextual/data/tcss/base.tcss')
__annotations__ = {'composed': <class 'asyncio.locks.Event'>, 'model': <class 'conntextual.ui.model.Model'>, 'tab_pattern': <class 'conntextual.ui.channel.pattern.PatternPair'>}
__orig_bases__ = (textual.app.App[NoneType],)
__parameters__ = ()

Methods inherited from textual.app.App:
__init__(self, driver_class: 'Type[Driver] | None' = None, css_path: 'CSSPathType | None' = None, watch_css: 'bool' = False)
Create an instance of an app.
 
Args:
    driver_class: Driver class or `None` to auto-detect.
        This will be used by some Textual tools.
    css_path: Path to CSS or `None` to use the `CSS_PATH` class variable.
        To load multiple CSS files, pass a list of strings or paths which
        will be loaded in order.
    watch_css: Reload CSS if the files changed. This is set automatically if
        you are using `textual run` with the `dev` switch.
 
Raises:
    CssPathError: When the supplied CSS path(s) are an unexpected type.
__repr__ = auto_repr(self: ~T) -> str
Return repr(self)
__rich_repr__(self) -> 'rich.repr.Result'
async action_add_class(self, selector: 'str', class_name: 'str') -> 'None'
An [action](/guide/actions) to add a CSS class to the selected widget.
 
Args:
    selector: Selects the widget to add the class to.
    class_name: The class to add to the selected widget.
async action_back(self) -> 'None'
An [action](/guide/actions) to go back to the previous screen (pop the current screen).
 
Note:
    If there is no screen to go back to, this is a non-operation (in
    other words it's safe to call even if there are no other screens
    on the stack.)
async action_bell(self) -> 'None'
An [action](/guide/actions) to play the terminal 'bell'.
async action_check_bindings(self, key: 'str') -> 'None'
An [action](/guide/actions) to handle a key press using the binding system.
 
Args:
    key: The key to process.
action_command_palette(self) -> 'None'
Show the Textual command palette.
async action_focus(self, widget_id: 'str') -> 'None'
An [action](/guide/actions) to focus the given widget.
 
Args:
    widget_id: ID of widget to focus.
action_focus_next(self) -> 'None'
An [action](/guide/actions) to focus the next widget.
action_focus_previous(self) -> 'None'
An [action](/guide/actions) to focus the previous widget.
async action_pop_screen(self) -> 'None'
An [action](/guide/actions) to remove the topmost screen and makes the new topmost screen active.
async action_push_screen(self, screen: 'str') -> 'None'
An [action](/guide/actions) to push a new screen on to the stack and make it active.
 
Args:
    screen: Name of the screen.
async action_remove_class(self, selector: 'str', class_name: 'str') -> 'None'
An [action](/guide/actions) to remove a CSS class from the selected widget.
 
Args:
    selector: Selects the widget to remove the class from.
    class_name: The class to remove from  the selected widget.
action_screenshot(self, filename: 'str | None' = None, path: 'str' = './') -> 'None'
This [action](/guide/actions) will save an SVG file containing the current contents of the screen.
 
Args:
    filename: Filename of screenshot, or None to auto-generate.
    path: Path to directory. Defaults to current working directory.
action_suspend_process(self) -> 'None'
Suspend the process into the background.
 
Note:
    On Unix and Unix-like systems a `SIGTSTP` is sent to the
    application's process. Currently on Windows and when running
    under Textual Web this is a non-operation.
async action_switch_mode(self, mode: 'str') -> 'None'
An [action](/guide/actions) that switches to the given mode..
async action_switch_screen(self, screen: 'str') -> 'None'
An [action](/guide/actions) to switch screens.
 
Args:
    screen: Name of the screen.
async action_toggle_class(self, selector: 'str', class_name: 'str') -> 'None'
An [action](/guide/actions) to toggle a CSS class on the selected widget.
 
Args:
    selector: Selects the widget to toggle the class on.
    class_name: The class to toggle on the selected widget.
action_toggle_dark(self) -> 'None'
An [action](/guide/actions) to toggle dark mode.
add_mode(self, mode: 'str', base_screen: 'str | Screen | Callable[[], Screen]') -> 'None'
Adds a mode and its corresponding base screen to the app.
 
Args:
    mode: The new mode.
    base_screen: The base screen associated with the given mode.
 
Raises:
    InvalidModeError: If the name of the mode is not valid/duplicated.
animate(self, attribute: 'str', value: 'float | Animatable', *, final_value: 'object' = Ellipsis, duration: 'float | None' = None, speed: 'float | None' = None, delay: 'float' = 0.0, easing: 'EasingFunction | str' = 'in_out_cubic', on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'full') -> 'None'
Animate an attribute.
 
See the guide for how to use the [animation](/guide/animation) system.
 
Args:
    attribute: Name of the attribute to animate.
    value: The value to animate to.
    final_value: The final value of the animation.
    duration: The duration (in seconds) of the animation.
    speed: The speed of the animation.
    delay: A delay (in seconds) before the animation starts.
    easing: An easing method.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
batch_update(self) -> 'Generator[None, None, None]'
A context manager to suspend all repaints until the end of the batch.
begin_capture_print(self, target: 'MessageTarget', stdout: 'bool' = True, stderr: 'bool' = True) -> 'None'
Capture content that is printed (or written to stdout / stderr).
 
If printing is captured, the `target` will be sent an [events.Print][textual.events.Print] message.
 
Args:
    target: The widget where print content will be sent.
    stdout: Capture stdout.
    stderr: Capture stderr.
bell(self) -> 'None'
Play the console 'bell'.
 
For terminals that support a bell, this typically makes a notification or error sound.
Some terminals may make no sound or display a visual bell indicator, depending on configuration.
bind(self, keys: 'str', action: 'str', *, description: 'str' = '', show: 'bool' = True, key_display: 'str | None' = None) -> 'None'
Bind a key to an action.
 
Args:
    keys: A comma separated list of keys, i.e.
    action: Action to bind to.
    description: Short description of action.
    show: Show key in UI.
    key_display: Replacement text for key, or None to use default.
call_from_thread(self, callback: 'Callable[..., CallThreadReturnType | Awaitable[CallThreadReturnType]]', *args: 'Any', **kwargs: 'Any') -> 'CallThreadReturnType'
Run a callable from another thread, and return the result.
 
Like asyncio apps in general, Textual apps are not thread-safe. If you call methods
or set attributes on Textual objects from a thread, you may get unpredictable results.
 
This method will ensure that your code runs within the correct context.
 
!!! tip
 
    Consider using [post_message][textual.message_pump.MessagePump.post_message] which is also thread-safe.
 
Args:
    callback: A callable to run.
    *args: Arguments to the callback.
    **kwargs: Keyword arguments for the callback.
 
Raises:
    RuntimeError: If the app isn't running or if this method is called from the same
        thread where the app is running.
 
Returns:
    The result of the callback.
capture_mouse(self, widget: 'Widget | None') -> 'None'
Send all mouse events to the given widget or disable mouse capture.
 
Args:
    widget: If a widget, capture mouse event, or `None` to end mouse capture.
async check_bindings(self, key: 'str', priority: 'bool' = False) -> 'bool'
Handle a key press.
 
This method is used internally by the bindings system, but may be called directly
if you wish to *simulate* a key being pressed.
 
Args:
    key: A key.
    priority: If `True` check from `App` down, otherwise from focused up.
 
Returns:
    True if the key was handled by a binding, otherwise False
clear_notifications(self) -> 'None'
Clear all the current notifications.
copy_to_clipboard(self, text: 'str') -> 'None'
Copy text to the clipboard.
 
!!! note
 
    This does not work on macOS Terminal, but will work on most other terminals.
 
Args:
    text: Text you wish to copy to the clipboard.
end_capture_print(self, target: 'MessageTarget') -> 'None'
End capturing of prints.
 
Args:
    target: The widget that was capturing prints.
exit(self, result: 'ReturnType | None' = None, return_code: 'int' = 0, message: 'RenderableType | None' = None) -> 'None'
Exit the app, and return the supplied result.
 
Args:
    result: Return value.
    return_code: The return code. Use non-zero values for error codes.
    message: Optional message to display on exit.
export_screenshot(self, *, title: 'str | None' = None) -> 'str'
Export an SVG screenshot of the current screen.
 
See also [save_screenshot][textual.app.App.save_screenshot] which writes the screenshot to a file.
 
Args:
    title: The title of the exported screenshot or None
        to use app title.
get_child_by_id(self, id: 'str', expect_type: 'type[ExpectType] | None' = None) -> 'ExpectType | Widget'
Get the first child (immediate descendent) of this DOMNode with the given ID.
 
Args:
    id: The ID of the node to search for.
    expect_type: Require the object be of the supplied type,
        or use `None` to apply no type restriction.
 
Returns:
    The first child of this node with the specified ID.
 
Raises:
    NoMatches: If no children could be found for this ID.
    WrongType: If the wrong type was found.
get_child_by_type(self, expect_type: 'type[ExpectType]') -> 'ExpectType'
Get a child of a give type.
 
Args:
    expect_type: The type of the expected child.
 
Raises:
    NoMatches: If no valid child is found.
 
Returns:
    A widget.
get_css_variables(self) -> 'dict[str, str]'
Get a mapping of variables used to pre-populate CSS.
 
May be implemented in a subclass to add new CSS variables.
 
Returns:
    A mapping of variable name to value.
get_driver_class(self) -> 'Type[Driver]'
Get a driver class for this platform.
 
This method is called by the constructor, and unlikely to be required when
building a Textual app.
 
Returns:
    A Driver class which manages input and display.
get_key_display(self, key: 'str') -> 'str'
For a given key, return how it should be displayed in an app
(e.g. in the Footer widget).
By key, we refer to the string used in the "key" argument for
a Binding instance. By overriding this method, you can ensure that
keys are displayed consistently throughout your app, without
needing to add a key_display to every binding.
 
Args:
    key: The binding key string.
 
Returns:
    The display string for the input key.
get_loading_widget(self) -> 'Widget'
Get a widget to be used as a loading indicator.
 
Extend this method if you want to display the loading state a little differently.
 
Returns:
    A widget to display a loading state.
get_screen(self, screen: 'Screen | str') -> 'Screen'
Get an installed screen.
 
Args:
    screen: Either a Screen object or screen name (the `name` argument when installed).
 
Raises:
    KeyError: If the named screen doesn't exist.
 
Returns:
    A screen instance.
get_widget_at(self, x: 'int', y: 'int') -> 'tuple[Widget, Region]'
Get the widget under the given coordinates.
 
Args:
    x: X coordinate.
    y: Y coordinate.
 
Returns:
    The widget and the widget's screen region.
get_widget_by_id(self, id: 'str', expect_type: 'type[ExpectType] | None' = None) -> 'ExpectType | Widget'
Get the first descendant widget with the given ID.
 
Performs a breadth-first search rooted at the current screen.
It will not return the Screen if that matches the ID.
To get the screen, use `self.screen`.
 
Args:
    id: The ID to search for in the subtree
    expect_type: Require the object be of the supplied type, or None for any type.
        Defaults to None.
 
Returns:
    The first descendant encountered with this ID.
 
Raises:
    NoMatches: if no children could be found for this ID
    WrongType: if the wrong type was found.
install_screen(self, screen: 'Screen', name: 'str') -> 'None'
Install a screen.
 
Installing a screen prevents Textual from destroying it when it is no longer on the screen stack.
Note that you don't need to install a screen to use it. See [push_screen][textual.app.App.push_screen]
or [switch_screen][textual.app.App.switch_screen] to make a new screen current.
 
Args:
    screen: Screen to install.
    name: Unique name to identify the screen.
 
Raises:
    ScreenError: If the screen can't be installed.
 
Returns:
    An awaitable that awaits the mounting of the screen and its children.
is_mounted(self, widget: 'Widget') -> 'bool'
Check if a widget is mounted.
 
Args:
    widget: A widget.
 
Returns:
    True of the widget is mounted.
is_screen_installed(self, screen: 'Screen | str') -> 'bool'
Check if a given screen has been installed.
 
Args:
    screen: Either a Screen object or screen name (the `name` argument when installed).
 
Returns:
    True if the screen is currently installed,
mount(self, *widgets: 'Widget', before: 'int | str | Widget | None' = None, after: 'int | str | Widget | None' = None) -> 'AwaitMount'
Mount the given widgets relative to the app's screen.
 
Args:
    *widgets: The widget(s) to mount.
    before: Optional location to mount before. An `int` is the index
        of the child to mount before, a `str` is a `query_one` query to
        find the widget to mount before.
    after: Optional location to mount after. An `int` is the index
        of the child to mount after, a `str` is a `query_one` query to
        find the widget to mount after.
 
Returns:
    An awaitable object that waits for widgets to be mounted.
 
Raises:
    MountError: If there is a problem with the mount request.
 
Note:
    Only one of ``before`` or ``after`` can be provided. If both are
    provided a ``MountError`` will be raised.
mount_all(self, widgets: 'Iterable[Widget]', *, before: 'int | str | Widget | None' = None, after: 'int | str | Widget | None' = None) -> 'AwaitMount'
Mount widgets from an iterable.
 
Args:
    widgets: An iterable of widgets.
    before: Optional location to mount before. An `int` is the index
        of the child to mount before, a `str` is a `query_one` query to
        find the widget to mount before.
    after: Optional location to mount after. An `int` is the index
        of the child to mount after, a `str` is a `query_one` query to
        find the widget to mount after.
 
Returns:
    An awaitable object that waits for widgets to be mounted.
 
Raises:
    MountError: If there is a problem with the mount request.
 
Note:
    Only one of ``before`` or ``after`` can be provided. If both are
    provided a ``MountError`` will be raised.
notify(self, message: 'str', *, title: 'str' = '', severity: 'SeverityLevel' = 'information', timeout: 'float' = 5) -> 'None'
Create a notification.
 
!!! tip
 
    This method is thread-safe.
 
 
Args:
    message: The message for the notification.
    title: The title for the notification.
    severity: The severity of the notification.
    timeout: The timeout (in seconds) for the notification.
 
The `notify` method is used to create an application-wide
notification, shown in a [`Toast`][textual.widgets._toast.Toast],
normally originating in the bottom right corner of the display.
 
Notifications can have the following severity levels:
 
- `information`
- `warning`
- `error`
 
The default is `information`.
 
Example:
    ```python
    # Show an information notification.
    self.notify("It's an older code, sir, but it checks out.")
 
    # Show a warning. Note that Textual's notification system allows
    # for the use of Rich console markup.
    self.notify(
        "Now witness the firepower of this fully "
        "[b]ARMED[/b] and [i][b]OPERATIONAL[/b][/i] battle station!",
        title="Possible trap detected",
        severity="warning",
    )
 
    # Show an error. Set a longer timeout so it's noticed.
    self.notify("It's a trap!", severity="error", timeout=10)
 
    # Show an information notification, but without any sort of title.
    self.notify("It's against my programming to impersonate a deity.", title="")
    ```
async on_event(self, event: 'events.Event') -> 'None'
Called to process an event.
 
Args:
    event: An Event object.
panic(self, *renderables: 'RenderableType') -> 'None'
Exits the app and display error message(s).
 
Used in response to unexpected errors.
For a more graceful exit, see the [exit][textual.app.App.exit] method.
 
Args:
    *renderables: Text or Rich renderable(s) to display on exit.
pop_screen(self) -> 'Screen[object]'
Pop the current [screen](/guide/screens) from the stack, and switch to the previous screen.
 
Returns:
    The screen that was replaced.
post_display_hook(self) -> 'None'
Called immediately after a display is done. Used in tests.
push_screen(self, screen: 'Screen[ScreenResultType] | str', callback: 'ScreenResultCallbackType[ScreenResultType] | None' = None, wait_for_dismiss: 'bool' = False) -> 'AwaitMount | asyncio.Future[ScreenResultType]'
Push a new [screen](/guide/screens) on the screen stack, making it the current screen.
 
Args:
    screen: A Screen instance or the name of an installed screen.
    callback: An optional callback function that will be called if the screen is [dismissed][textual.screen.Screen.dismiss] with a result.
    wait_for_dismiss: If `True`, awaiting this method will return the dismiss value from the screen. When set to `False`, awaiting
        this method will wait for the screen to be mounted. Note that `wait_for_dismiss` should only be set to `True` when running in a worker.
 
Raises:
    NoActiveWorker: If using `wait_for_dismiss` outside of a worker.
 
Returns:
    An optional awaitable that awaits the mounting of the screen and its children, or an asyncio Future
        to await the result of the screen.
async push_screen_wait(self, screen: 'Screen[ScreenResultType] | str') -> 'ScreenResultType | Any'
Push a screen and wait for the result (received from [`Screen.dismiss`][textual.screen.Screen.dismiss]).
 
Note that this method may only be called when running in a worker.
 
Args:
    screen: A screen or the name of an installed screen.
 
Returns:
    The screen's result.
async recompose(self) -> 'None'
Recompose the widget.
 
Recomposing will remove children and call `self.compose` again to remount.
refresh(self, *, repaint: 'bool' = True, layout: 'bool' = False, recompose: 'bool' = False) -> 'Self'
Refresh the entire screen.
 
Args:
    repaint: Repaint the widget (will call render() again).
    layout: Also layout widgets in the view.
    recompose: Re-compose the widget (will remove and re-mount children).
 
Returns:
    The `App` instance.
refresh_css(self, animate: 'bool' = True) -> 'None'
Refresh CSS.
 
Args:
    animate: Also execute CSS animations.
remove_mode(self, mode: 'str') -> 'None'
Removes a mode from the app.
 
Screens that are running in the stack of that mode are scheduled for pruning.
 
Args:
    mode: The mode to remove. It can't be the active mode.
 
Raises:
    ActiveModeError: If trying to remove the active mode.
    UnknownModeError: If trying to remove an unknown mode.
render(self) -> 'RenderResult'
Render method inherited from widget, to render the screen's background.
 
May be override to customize background visuals.
run(self, *, headless: 'bool' = False, inline: 'bool' = False, inline_no_clear: 'bool' = False, mouse: 'bool' = True, size: 'tuple[int, int] | None' = None, auto_pilot: 'AutopilotCallbackType | None' = None) -> 'ReturnType | None'
Run the app.
 
Args:
    headless: Run in headless mode (no output).
    inline: Run the app inline (under the prompt).
    inline_no_clear: Don't clear the app output when exiting an inline app.
    mouse: Enable mouse support.
    size: Force terminal size to `(WIDTH, HEIGHT)`,
        or None to auto-detect.
    auto_pilot: An auto pilot coroutine.
 
Returns:
    App return value.
async run_action(self, action: 'str | ActionParseResult', default_namespace: 'object | None' = None) -> 'bool'
Perform an [action](/guide/actions).
 
Actions are typically associated with key bindings, where you wouldn't need to call this method manually.
 
Args:
    action: Action encoded in a string.
    default_namespace: Namespace to use if not provided in the action,
        or None to use app.
 
Returns:
    True if the event has been handled.
async run_async(self, *, headless: 'bool' = False, inline: 'bool' = False, inline_no_clear: 'bool' = False, mouse: 'bool' = True, size: 'tuple[int, int] | None' = None, auto_pilot: 'AutopilotCallbackType | None' = None) -> 'ReturnType | None'
Run the app asynchronously.
 
Args:
    headless: Run in headless mode (no output).
    inline: Run the app inline (under the prompt).
    inline_no_clear: Don't clear the app output when exiting an inline app.
    mouse: Enable mouse support.
    size: Force terminal size to `(WIDTH, HEIGHT)`,
        or None to auto-detect.
    auto_pilot: An auto pilot coroutine.
 
Returns:
    App return value.
run_test(self, *, headless: 'bool' = True, size: 'tuple[int, int] | None' = (80, 24), tooltips: 'bool' = False, notifications: 'bool' = False, message_hook: 'Callable[[Message], None] | None' = None) -> 'AsyncGenerator[Pilot[ReturnType], None]'
An asynchronous context manager for testing apps.
 
!!! tip
 
    See the guide for [testing](/guide/testing) Textual apps.
 
Use this to run your app in "headless" mode (no output) and drive the app via a [Pilot][textual.pilot.Pilot] object.
 
Example:
 
    ```python
    async with app.run_test() as pilot:
        await pilot.click("#Button.ok")
        assert ...
    ```
 
Args:
    headless: Run in headless mode (no output or input).
    size: Force terminal size to `(WIDTH, HEIGHT)`,
        or None to auto-detect.
    tooltips: Enable tooltips when testing.
    notifications: Enable notifications when testing.
    message_hook: An optional callback that will be called each time any message arrives at any
        message pump in the app.
save_screenshot(self, filename: 'str | None' = None, path: 'str | None' = None, time_format: 'str | None' = None) -> 'str'
Save an SVG screenshot of the current screen.
 
Args:
    filename: Filename of SVG screenshot, or None to auto-generate
        a filename with the date and time.
    path: Path to directory for output. Defaults to current working directory.
    time_format: Date and time format to use if filename is None.
        Defaults to a format like ISO 8601 with some reserved characters replaced with underscores.
 
Returns:
    Filename of screenshot.
set_focus(self, widget: 'Widget | None', scroll_visible: 'bool' = True) -> 'None'
Focus (or unfocus) a widget. A focused widget will receive key events first.
 
Args:
    widget: Widget to focus.
    scroll_visible: Scroll widget in to view.
async stop_animation(self, attribute: 'str', complete: 'bool' = True) -> 'None'
Stop an animation on an attribute.
 
Args:
    attribute: Name of the attribute whose animation should be stopped.
    complete: Should the animation be set to its final value?
 
Note:
    If there is no animation scheduled or running, this is a no-op.
suspend(self) -> 'Iterator[None]'
A context manager that temporarily suspends the app.
 
While inside the `with` block, the app will stop reading input and
emitting output. Other applications will have full control of the
terminal, configured as it was before the app started running. When
the `with` block ends, the application will start reading input and
emitting output again.
 
Example:
    ```python
    with self.suspend():
        os.system("emacs -nw")
    ```
 
Raises:
    SuspendNotSupported: If the environment doesn't support suspending.
 
!!! note
    Suspending the application is currently only supported on
    Unix-like operating systems and Microsoft Windows. Suspending is
    not supported in Textual Web.
switch_mode(self, mode: 'str') -> 'AwaitMount'
Switch to a given mode.
 
Args:
    mode: The mode to switch to.
 
Returns:
    An optionally awaitable object which waits for the screen associated
        with the mode to be mounted.
 
Raises:
    UnknownModeError: If trying to switch to an unknown mode.
switch_screen(self, screen: 'Screen | str') -> 'AwaitMount'
Switch to another [screen](/guide/screens) by replacing the top of the screen stack with a new screen.
 
Args:
    screen: Either a Screen object or screen name (the `name` argument when installed).
uninstall_screen(self, screen: 'Screen | str') -> 'str | None'
Uninstall a screen.
 
If the screen was not previously installed then this method is a null-op.
Uninstalling a screen allows Textual to delete it when it is popped or switched.
Note that uninstalling a screen is only required if you have previously installed it
with [install_screen][textual.app.App.install_screen].
Textual will also uninstall screens automatically on exit.
 
Args:
    screen: The screen to uninstall or the name of a installed screen.
 
Returns:
    The name of the screen that was uninstalled, or None if no screen was uninstalled.
update_styles(self, node: 'DOMNode') -> 'None'
Immediately update the styles of this node and all descendant nodes.
 
Should be called whenever CSS classes / pseudo classes change.
For example, when you hover over a button, the :hover pseudo class
will be added, and this method is called to apply the corresponding
:hover styles.
validate_sub_title(self, sub_title: 'Any') -> 'str'
Make sure the sub-title is set to a string.
validate_title(self, title: 'Any') -> 'str'
Make sure the title is set to a string.
watch_ansi_theme_dark(self, theme: 'TerminalTheme') -> 'None'
watch_ansi_theme_light(self, theme: 'TerminalTheme') -> 'None'
watch_dark(self, dark: 'bool') -> 'None'
Watches the dark bool.
 
This method handles the transition between light and dark mode when you
change the [dark][textual.app.App.dark] attribute.

Readonly properties inherited from textual.app.App:
animator
The animator object.
ansi_theme
The ANSI TerminalTheme currently being used.
 
Defines how colors defined as ANSI (e.g. `magenta`) inside Rich renderables
are mapped to hex codes.
children
A view onto the app's immediate children.
 
This attribute exists on all widgets.
In the case of the App, it will only ever contain a single child, which will
be the currently active screen.
 
Returns:
    A sequence of widgets.
current_mode
The name of the currently active mode.
debug
Is debug mode enabled?
focused
The widget that is focused on the currently active screen, or `None`.
 
Focused widgets receive keyboard input.
 
Returns:
    The currently focused widget, or `None` if nothing is focused.
is_headless
Is the app running in 'headless' mode?
 
Headless mode is used when running tests with [run_test][textual.app.App.run_test].
is_inline
Is the app running in 'inline' mode?
log
The textual logger.
 
Example:
    ```python
    self.log("Hello, World!")
    self.log(self.tree)
    ```
 
Returns:
    A Textual logger.
namespace_bindings
Get currently active bindings.
 
If no widget is focused, then app-level bindings are returned.
If a widget is focused, then any bindings present in the active screen and app are merged and returned.
 
This property may be used to inspect current bindings.
 
Returns:
    A map of keys to a tuple containing the DOMNode and Binding that key corresponds to.
return_code
The return code with which the app exited.
 
Non-zero codes indicate errors.
A value of 1 means the app exited with a fatal error.
If the app wasn't exited yet, this will be `None`.
 
Example:
    The return code can be used to exit the process via `sys.exit`.
    ```py
    my_app.run()
    sys.exit(my_app.return_code)
    ```
return_value
The return value of the app, or `None` if it has not yet been set.
 
The return value is set when calling [exit][textual.app.App.exit].
screen
The current active screen.
 
Returns:
    The currently active (visible) screen.
 
Raises:
    ScreenStackError: If there are no screens on the stack.
screen_stack
A snapshot of the current screen stack.
 
Returns:
    A snapshot of the current state of the screen stack.
size
The size of the terminal.
 
Returns:
    Size of the terminal.
workers
The [worker](/guide/workers/) manager.
 
Returns:
    An object to manage workers.

Data descriptors inherited from textual.app.App:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object
ansi_theme_dark
ansi_theme_light
app_focus
dark
sub_title
title

Data and other attributes inherited from textual.app.App:
AUTO_FOCUS = '*'
COMMANDS = {<function get_system_commands>}
CSS = ''
DEFAULT_CSS = '\n App {\n background: $background;\n ...bled:can-focus {\n opacity: 0.7;\n }\n '
ENABLE_COMMAND_PALETTE = True
ExpectType = ~ExpectType
MODES = {}
SCREENS = {}
SUB_TITLE = None
TITLE = None

Class methods inherited from typing.Generic:
__class_getitem__(...) from textual.message_pump._MessagePumpMeta
Parameterizes a generic class.
 
At least, parameterizing a generic class is the *main* thing this
method does. For example, for some generic class `Foo`, this is called
when we do `Foo[int]` - there, with `cls=Foo` and `params=int`.
 
However, note that this method is also called when defining generic
classes in the first place with `class Foo[T]: ...`.
__init_subclass__(...) from textual.message_pump._MessagePumpMeta
Function to initialize subclasses.

Methods inherited from textual.dom.DOMNode:
async action_toggle(self, attribute_name: 'str') -> 'None'
Toggle an attribute on the node.
 
Assumes the attribute is a bool.
 
Args:
    attribute_name: Name of the attribute.
add_class(self, *class_names: 'str', update: 'bool' = True) -> 'Self'
Add class names to this Node.
 
Args:
    *class_names: CSS class names to add.
    update: Also update styles.
 
Returns:
    Self.
compose_add_child(self, widget: 'Widget') -> 'None'
Add a node to children.
 
This is used by the compose process when it adds children.
There is no need to use it directly, but you may want to override it in a subclass
if you want children to be attached to a different node.
 
Args:
    widget: A Widget to add.
data_bind(self, *reactives: 'Reactive[Any]', **bind_vars: 'Reactive[Any] | object') -> 'Self'
Bind reactive data so that changes to a reactive automatically change the reactive on another widget.
 
Reactives may be given as positional arguments or keyword arguments.
See the [guide on data binding](/guide/reactivity#data-binding).
 
Example:
    ```python
    def compose(self) -> ComposeResult:
        yield WorldClock("Europe/London").data_bind(WorldClockApp.time)
        yield WorldClock("Europe/Paris").data_bind(WorldClockApp.time)
        yield WorldClock("Asia/Tokyo").data_bind(WorldClockApp.time)
    ```
 
Raises:
    ReactiveError: If the data wasn't bound.
 
Returns:
    Self.
get_component_styles(self, name: 'str') -> 'RenderStyles'
Get a "component" styles object (must be defined in COMPONENT_CLASSES classvar).
 
Args:
    name: Name of the component.
 
Raises:
    KeyError: If the component class doesn't exist.
 
Returns:
    A Styles object.
get_pseudo_classes(self) -> 'Iterable[str]'
Get any pseudo classes applicable to this Node, e.g. hover, focus.
 
Returns:
    Iterable of strings, such as a generator.
has_class(self, *class_names: 'str') -> 'bool'
Check if the Node has all the given class names.
 
Args:
    *class_names: CSS class names to check.
 
Returns:
    ``True`` if the node has all the given class names, otherwise ``False``.
has_pseudo_class(self, class_name: 'str') -> 'bool'
Check the node has the given pseudo class.
 
Args:
    class_name: The pseudo class to check for.
 
Returns:
    `True` if the DOM node has the pseudo class, `False` if not.
has_pseudo_classes(self, class_names: 'set[str]') -> 'bool'
Check the node has all the given pseudo classes.
 
Args:
    class_names: Set of class names to check for.
 
Returns:
    `True` if all pseudo class names are present.
notify_style_update(self) -> 'None'
Called after styles are updated.
 
Implement this in a subclass if you want to clear any cached data when the CSS is reloaded.
query(self, selector: 'str | type[QueryType] | None' = None) -> 'DOMQuery[Widget] | DOMQuery[QueryType]'
Query the DOM for children that match a selector or widget type.
 
Args:
    selector: A CSS selector, widget type, or `None` for all nodes.
 
Returns:
    A query object.
query_one(self, selector: 'str | type[QueryType]', expect_type: 'type[QueryType] | None' = None) -> 'QueryType | Widget'
Get a widget from this widget's children that matches a selector or widget type.
 
Args:
    selector: A selector or widget type.
    expect_type: Require the object be of the supplied type, or None for any type.
 
Raises:
    WrongType: If the wrong type was found.
    NoMatches: If no node matches the query.
    TooManyMatches: If there is more than one matching node in the query.
 
Returns:
    A widget matching the selector.
remove_class(self, *class_names: 'str', update: 'bool' = True) -> 'Self'
Remove class names from this Node.
 
Args:
    *class_names: CSS class names to remove.
    update: Also update styles.
 
Returns:
    Self.
reset_styles(self) -> 'None'
Reset styles back to their initial state.
run_worker(self, work: 'WorkType[ResultType]', name: 'str | None' = '', group: 'str' = 'default', description: 'str' = '', exit_on_error: 'bool' = True, start: 'bool' = True, exclusive: 'bool' = False, thread: 'bool' = False) -> 'Worker[ResultType]'
Run work in a worker.
 
A worker runs a function, coroutine, or awaitable, in the *background* as an async task or as a thread.
 
Args:
    work: A function, async function, or an awaitable object to run in a worker.
    name: A short string to identify the worker (in logs and debugging).
    group: A short string to identify a group of workers.
    description: A longer string to store longer information on the worker.
    exit_on_error: Exit the app if the worker raises an error. Set to `False` to suppress exceptions.
    start: Start the worker immediately.
    exclusive: Cancel all workers in the same group.
    thread: Mark the worker as a thread worker.
 
Returns:
    New Worker instance.
set_class(self, add: 'bool', *class_names: 'str', update: 'bool' = True) -> 'Self'
Add or remove class(es) based on a condition.
 
Args:
    add: Add the classes if True, otherwise remove them.
    update: Also update styles.
 
Returns:
    Self.
set_classes(self, classes: 'str | Iterable[str]') -> 'Self'
Replace all classes.
 
Args:
    classes: A string containing space separated classes, or an
        iterable of class names.
 
Returns:
    Self.
set_reactive(self, reactive: 'Reactive[ReactiveType]', value: 'ReactiveType') -> 'None'
Sets a reactive value *without* invoking validators or watchers.
 
Example:
    ```python
    self.set_reactive(App.dark_mode, True)
    ```
 
Args:
    name: Name of reactive attribute.
    value: New value of reactive.
 
Raises:
    AttributeError: If the first argument is not a reactive.
set_styles(self, css: 'str | None' = None, **update_styles: 'Any') -> 'Self'
Set custom styles on this object.
 
Args:
    css: Styles in CSS format.
    update_styles: Keyword arguments map style names onto style values.
 
Returns:
    Self.
sort_children(self, *, key: 'Callable[[Widget], SupportsRichComparison] | None' = None, reverse: 'bool' = False) -> 'None'
Sort child widgets with an optional key function.
 
If `key` is not provided then widgets will be sorted in the order they are constructed.
 
Example:
    ```python
    # Sort widgets by name
    screen.sort_children(key=lambda widget: widget.name or "")
    ```
 
Args:
    key: A callable which accepts a widget and returns something that can be sorted,
        or `None` to sort without a key function.
    reverse: Sort in descending order.
toggle_class(self, *class_names: 'str') -> 'Self'
Toggle class names on this Node.
 
Args:
    *class_names: CSS class names to toggle.
 
Returns:
    Self.
walk_children(self, filter_type: 'type[WalkType] | None' = None, *, with_self: 'bool' = False, method: 'WalkMethod' = 'depth', reverse: 'bool' = False) -> 'list[DOMNode] | list[WalkType]'
Walk the subtree rooted at this node, and return every descendant encountered in a list.
 
Args:
    filter_type: Filter only this type, or None for no filter.
    with_self: Also yield self in addition to descendants.
    method: One of "depth" or "breadth".
    reverse: Reverse the order (bottom up).
 
Returns:
    A list of nodes.
watch(self, obj: 'DOMNode', attribute_name: 'str', callback: 'WatchCallbackType', init: 'bool' = True) -> 'None'
Watches for modifications to reactive attributes on another object.
 
Example:
 
    Here's how you could detect when the app changes from dark to light mode (and vice versa).
 
    ```python
    def on_dark_change(old_value:bool, new_value:bool):
        # Called when app.dark changes.
        print("App.dark when from {old_value} to {new_value}")
 
    self.watch(self.app, "dark", self.on_dark_change, init=False)
    ```
 
Args:
    obj: Object containing attribute to watch.
    attribute_name: Attribute to watch.
    callback: A callback to run when attribute changes.
    init: Check watchers on first call.

Readonly properties inherited from textual.dom.DOMNode:
ancestors
A list of ancestor nodes found by tracing a path all the way back to App.
 
Returns:
    A list of nodes.
ancestors_with_self
A list of ancestor nodes found by tracing a path all the way back to App.
 
Note:
    This is inclusive of ``self``.
 
Returns:
    A list of nodes.
background_colors
The background color and the color of the parent's background.
 
Returns:
    `(<background color>, <color>)`
colors
The widget's background and foreground colors, and the parent's background and foreground colors.
 
Returns:
    `(<parent background>, <parent color>, <background>, <color>)`
css_identifier
A CSS selector that identifies this DOM node.
css_identifier_styled
A syntax highlighted CSS identifier.
 
Returns:
    A Rich Text object.
css_path_nodes
A list of nodes from the App to this node, forming a "path".
 
Returns:
    A list of nodes, where the first item is the App, and the last is this node.
css_tree
A Rich tree to display the DOM, annotated with the node's CSS.
 
Log this to visualize your app in the textual console.
 
Example:
    ```python
    self.log(self.css_tree)
    ```
 
Returns:
    A Tree renderable.
displayed_children
The child nodes which will be displayed.
 
Returns:
    A list of nodes.
is_modal
Is the node a modal?
name
The name of the node.
parent
The parent node.
 
All nodes have parent once added to the DOM, with the exception of the App which is the *root* node.
pseudo_classes
A (frozen) set of all pseudo classes.
rich_style
Get a Rich Style object for this DOMNode.
 
Returns:
    A Rich style.
text_style
Get the text style object.
 
A widget's style is influenced by its parent. for instance if a parent is bold, then
the child will also be bold.
 
Returns:
    A Rich Style.
tree
A Rich tree to display the DOM.
 
Log this to visualize your app in the textual console.
 
Example:
    ```python
    self.log(self.tree)
    ```
 
Returns:
    A Tree renderable.

Data descriptors inherited from textual.dom.DOMNode:
auto_refresh
Number of seconds between automatic refresh, or `None` for no automatic refresh.
classes
display
Should the DOM node be displayed?
 
May be set to a boolean to show or hide the node, or to any valid value for the `display` rule.
 
Example:
    ```python
    my_widget.display = False  # Hide my_widget
    ```
id
The ID of this node, or None if the node has no ID.
visible
Is this widget visible in the DOM?
 
If a widget hasn't had its visibility set explicitly, then it inherits it from its
DOM ancestors.
 
This may be set explicitly to override inherited values.
The valid values include the valid values for the `visibility` rule and the booleans
`True` or `False`, to set the widget to be visible or invisible, respectively.
 
When a node is invisible, Textual will reserve space for it, but won't display anything.

Data and other attributes inherited from textual.dom.DOMNode:
COMPONENT_CLASSES = set()
DEFAULT_CLASSES = ''
SCOPED_CSS = True
WalkType = ~WalkType

Methods inherited from textual.message_pump.MessagePump:
call_after_refresh(self, callback: 'Callback', *args: 'Any', **kwargs: 'Any') -> 'bool'
Schedule a callback to run after all messages are processed and the screen
has been refreshed. Positional and keyword arguments are passed to the callable.
 
Args:
    callback: A callable.
 
Returns:
    `True` if the callback was scheduled, or `False` if the callback could not be
        scheduled (may occur if the message pump was closed or closing).
call_later(self, callback: 'Callback', *args: 'Any', **kwargs: 'Any') -> 'bool'
Schedule a callback to run after all messages are processed in this object.
Positional and keywords arguments are passed to the callable.
 
Args:
    callback: Callable to call next.
    *args: Positional arguments to pass to the callable.
    **kwargs: Keyword arguments to pass to the callable.
 
Returns:
    `True` if the callback was scheduled, or `False` if the callback could not be
        scheduled (may occur if the message pump was closed or closing).
call_next(self, callback: 'Callback', *args: 'Any', **kwargs: 'Any') -> 'None'
Schedule a callback to run immediately after processing the current message.
 
Args:
    callback: Callable to run after current event.
    *args: Positional arguments to pass to the callable.
    **kwargs: Keyword arguments to pass to the callable.
check_idle(self) -> 'None'
Prompt the message pump to call idle if the queue is empty.
check_message_enabled(self, message: 'Message') -> 'bool'
Check if a given message is enabled (allowed to be sent).
 
Args:
    message: A message object.
 
Returns:
    `True` if the message will be sent, or `False` if it is disabled.
disable_messages(self, *messages: 'type[Message]') -> 'None'
Disable message types from being processed.
async dispatch_key(self, event: 'events.Key') -> 'bool'
Dispatch a key event to method.
 
This method will call the method named 'key_<event.key>' if it exists.
Some keys have aliases. The first alias found will be invoked if it exists.
If multiple handlers exist that match the key, an exception is raised.
 
Args:
    event: A key event.
 
Returns:
    True if key was handled, otherwise False.
 
Raises:
    DuplicateKeyHandlers: When there's more than 1 handler that could handle this key.
enable_messages(self, *messages: 'type[Message]') -> 'None'
Enable processing of messages types.
async on_callback(self, event: 'events.Callback') -> 'None'
async on_timer(self, event: 'events.Timer') -> 'None'
post_message(self, message: 'Message') -> 'bool'
Posts a message on to this widget's queue.
 
Args:
    message: A message (including Event).
 
Returns:
    `True` if the messages was processed, `False` if it wasn't.
prevent(self, *message_types: 'type[Message]') -> 'Generator[None, None, None]'
A context manager to *temporarily* prevent the given message types from being posted.
 
Example:
    ```python
    input = self.query_one(Input)
    with self.prevent(Input.Changed):
        input.value = "foo"
    ```
set_interval(self, interval: 'float', callback: 'TimerCallback | None' = None, *, name: 'str | None' = None, repeat: 'int' = 0, pause: 'bool' = False) -> 'Timer'
Call a function at periodic intervals.
 
Args:
    interval: Time (in seconds) between calls.
    callback: Function to call.
    name: Name of the timer object.
    repeat: Number of times to repeat the call or 0 for continuous.
    pause: Start the timer paused.
 
Returns:
    A timer object.
set_timer(self, delay: 'float', callback: 'TimerCallback | None' = None, *, name: 'str | None' = None, pause: 'bool' = False) -> 'Timer'
Make a function call after a delay.
 
Args:
    delay: Time (in seconds) to wait before invoking callback.
    callback: Callback to call after time has expired.
    name: Name of the timer (for debug).
    pause: Start timer paused.
 
Returns:
    A timer object.

Readonly properties inherited from textual.message_pump.MessagePump:
app
Get the current app.
 
Returns:
    The current app.
 
Raises:
    NoActiveAppError: if no active app could be found for the current asyncio context
has_parent
Does this object have a parent?
is_attached
Is the node attached to the app via the DOM?
is_parent_active
Is the parent active?
is_running
Is the message pump running (potentially processing messages)?
message_queue_size
The current size of the message queue.
task

 
class ChannelEnvironmentDisplay(textual.widgets._static.Static)
    ChannelEnvironmentDisplay(renderable: 'RenderableType' = '', *, expand: 'bool' = False, shrink: 'bool' = False, markup: 'bool' = True, name: 'str | None' = None, id: 'str | None' = None, classes: 'str | None' = None, disabled: 'bool' = False) -&gt; 'None'
 
A channel-environment interface element.
 
 
Method resolution order:
ChannelEnvironmentDisplay
textual.widgets._static.Static
textual.widget.Widget
textual.dom.DOMNode
textual.message_pump.MessagePump
builtins.object

Methods defined here:
add_channel(self, name: str, chan: Union[runtimepy.channel.Channel[runtimepy.primitives.int.Int8Primitive], runtimepy.channel.Channel[runtimepy.primitives.int.Int16Primitive], runtimepy.channel.Channel[runtimepy.primitives.int.Int32Primitive], runtimepy.channel.Channel[runtimepy.primitives.int.Int64Primitive], runtimepy.channel.Channel[runtimepy.primitives.int.Uint8Primitive], runtimepy.channel.Channel[runtimepy.primitives.int.Uint16Primitive], runtimepy.channel.Channel[runtimepy.primitives.int.Uint32Primitive], runtimepy.channel.Channel[runtimepy.primitives.int.Uint64Primitive], runtimepy.channel.Channel[runtimepy.primitives.float.FloatPrimitive], runtimepy.channel.Channel[runtimepy.primitives.float.DoublePrimitive], runtimepy.channel.Channel[runtimepy.primitives.bool.BooleanPrimitive]], enum: Optional[runtimepy.enum.RuntimeEnum]) -> int
Add a channel to the table.
add_field(self, name: str) -> None
Add a bit-field row entry.
compose(self) -> Iterable[textual.widget.Widget]
Create child nodes.
handle_cell_selected(self, event: textual.widgets._data_table.DataTable.CellSelected) -> None
Handle input submission.
on_mount(self) -> None
Populate channel table.
random_channel(self) -> None
Switch to a random channel.
reset_plot(self) -> None
Reset the selected plot.
switch_to_channel(self, row: int) -> None
Switch the plot to a channel at the specified row.
update_channels(self, max_plot_samples: int, update_table: bool = True, update_log: bool = True, update_plot: bool = True) -> None
Update all channel values.

Static methods defined here:
create(name: str, command: runtimepy.channel.environment.command.processor.ChannelCommandProcessor, source: conntextual.ui.channel.model.ChannelEnvironmentSource, logger: Union[logging.Logger, logging.LoggerAdapter[Any]], app: runtimepy.net.arbiter.info.AppInfo, channel_pattern: conntextual.ui.channel.pattern.PatternPair) -> 'ChannelEnvironmentDisplay'
Create a channel-environment display.

Readonly properties defined here:
label
Obtain a label string for this instance.

Data and other attributes defined here:
__annotations__ = {'by_index': typing.List[typing.Tuple[textual.coordinate.Coordinate, typing.Union[str, int]]], 'channel_pattern': <class 'conntextual.ui.channel.pattern.PatternPair'>, 'channels_by_row': typing.Dict[int, conntextual.ui.channel.selected.SelectedChannel], 'model': <class 'conntextual.ui.channel.model.Model'>, 'row_idx': <class 'int'>, 'selected': <class 'conntextual.ui.channel.selected.SelectedChannel'>}
can_focus = False
can_focus_children = True

Methods inherited from textual.widgets._static.Static:
__init__(self, renderable: 'RenderableType' = '', *, expand: 'bool' = False, shrink: 'bool' = False, markup: 'bool' = True, name: 'str | None' = None, id: 'str | None' = None, classes: 'str | None' = None, disabled: 'bool' = False) -> 'None'
Initialize a Widget.
 
Args:
    *children: Child widgets.
    name: The name of the widget.
    id: The ID of the widget in the DOM.
    classes: The CSS classes for the widget.
    disabled: Whether the widget is disabled or not.
render(self) -> 'RenderResult'
Get a rich renderable for the widget's content.
 
Returns:
    A rich renderable.
update(self, renderable: 'RenderableType' = '') -> 'None'
Update the widget's content area with new text or Rich renderable.
 
Args:
    renderable: A new rich renderable. Defaults to empty renderable;

Data descriptors inherited from textual.widgets._static.Static:
renderable

Data and other attributes inherited from textual.widgets._static.Static:
DEFAULT_CSS = '\n Static {\n height: auto;\n }\n '

Methods inherited from textual.widget.Widget:
__enter__(self) -> 'Self'
Use as context manager when composing.
__exit__(self, exc_type: 'type[BaseException] | None', exc_val: 'BaseException | None', exc_tb: 'TracebackType | None') -> 'None'
Exit compose context manager.
__repr__ = auto_repr(self: ~T) -> str
Return repr(self)
__rich_repr__(self) -> 'rich.repr.Result'
action_page_down(self) -> 'None'
action_page_up(self) -> 'None'
action_scroll_down(self) -> 'None'
action_scroll_end(self) -> 'None'
action_scroll_home(self) -> 'None'
action_scroll_left(self) -> 'None'
action_scroll_right(self) -> 'None'
action_scroll_up(self) -> 'None'
allow_focus(self) -> 'bool'
Check if the widget is permitted to focus.
 
The base class returns [`can_focus`][textual.widget.Widget.can_focus].
This method maybe overridden if additional logic is required.
 
Returns:
    `True` if the widget may be focused, or `False` if it may not be focused.
allow_focus_children(self) -> 'bool'
Check if a widget's children may be focused.
 
The base class returns [`can_focus_children`][textual.widget.Widget.can_focus_children].
This method maybe overridden if additional logic is required.
 
Returns:
    `True` if the widget's children may be focused, or `False` if the widget's children may not be focused.
animate(self, attribute: 'str', value: 'float | Animatable', *, final_value: 'object' = Ellipsis, duration: 'float | None' = None, speed: 'float | None' = None, delay: 'float' = 0.0, easing: 'EasingFunction | str' = 'in_out_cubic', on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'full') -> 'None'
Animate an attribute.
 
Args:
    attribute: Name of the attribute to animate.
    value: The value to animate to.
    final_value: The final value of the animation. Defaults to `value` if not set.
    duration: The duration (in seconds) of the animation.
    speed: The speed of the animation.
    delay: A delay (in seconds) before the animation starts.
    easing: An easing method.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
batch(self) -> 'AsyncGenerator[None, None]'
Async context manager that combines widget locking and update batching.
 
Use this async context manager whenever you want to acquire the widget lock and
batch app updates at the same time.
 
Example:
    ```py
    async with container.batch():
        await container.remove_children(Button)
        await container.mount(Label("All buttons are gone."))
    ```
begin_capture_print(self, stdout: 'bool' = True, stderr: 'bool' = True) -> 'None'
Capture text from print statements (or writes to stdout / stderr).
 
If printing is captured, the widget will be sent an [`events.Print`][textual.events.Print] message.
 
Call [`end_capture_print`][textual.widget.Widget.end_capture_print] to disable print capture.
 
Args:
    stdout: Whether to capture stdout.
    stderr: Whether to capture stderr.
blur(self) -> 'Self'
Blur (un-focus) the widget.
 
Focus will be moved to the next available widget in the focus chain..
 
Returns:
    The `Widget` instance.
async broker_event(self, event_name: 'str', event: 'events.Event') -> 'bool'
can_view(self, widget: 'Widget') -> 'bool'
Check if a given widget is in the current view (scrollable area).
 
Note: This doesn't necessarily equate to a widget being visible.
There are other reasons why a widget may not be visible.
 
Args:
    widget: A widget that is a descendant of self.
 
Returns:
    True if the entire widget is in view, False if it is partially visible or not in view.
capture_mouse(self, capture: 'bool' = True) -> 'None'
Capture (or release) the mouse.
 
When captured, mouse events will go to this widget even when the pointer is not directly over the widget.
 
Args:
    capture: True to capture or False to release.
check_message_enabled(self, message: 'Message') -> 'bool'
Check if a given message is enabled (allowed to be sent).
 
Args:
    message: A message object
 
Returns:
    `True` if the message will be sent, or `False` if it is disabled.
clear_cached_dimensions(self) -> 'None'
Clear cached results of `get_content_width` and `get_content_height`.
 
Call if the widget's renderable changes size after the widget has been created.
 
!!! note
 
    This is not required if you are extending [`Static`][textual.widgets.Static].
compose_add_child(self, widget: 'Widget') -> 'None'
Add a node to children.
 
This is used by the compose process when it adds children.
There is no need to use it directly, but you may want to override it in a subclass
if you want children to be attached to a different node.
 
Args:
    widget: A Widget to add.
end_capture_print(self) -> 'None'
End print capture (set with [`begin_capture_print`][textual.widget.Widget.begin_capture_print]).
focus(self, scroll_visible: 'bool' = True) -> 'Self'
Give focus to this widget.
 
Args:
    scroll_visible: Scroll parent to make this widget visible.
 
Returns:
    The `Widget` instance.
get_child_by_id(self, id: 'str', expect_type: 'type[ExpectType] | None' = None) -> 'ExpectType | Widget'
Return the first child (immediate descendent) of this node with the given ID.
 
Args:
    id: The ID of the child.
    expect_type: Require the object be of the supplied type, or None for any type.
 
Returns:
    The first child of this node with the ID.
 
Raises:
    NoMatches: if no children could be found for this ID
    WrongType: if the wrong type was found.
get_child_by_type(self, expect_type: 'type[ExpectType]') -> 'ExpectType'
Get the first immediate child of a given type.
 
Only returns exact matches, and so will not match subclasses of the given type.
 
Args:
    expect_type: The type of the child to search for.
 
Raises:
    NoMatches: If no matching child is found.
 
Returns:
    The first immediate child widget with the expected type.
get_component_rich_style(self, name: 'str', *, partial: 'bool' = False) -> 'Style'
Get a *Rich* style for a component.
 
Args:
    name: Name of component.
    partial: Return a partial style (not combined with parent).
 
Returns:
    A Rich style object.
get_content_height(self, container: 'Size', viewport: 'Size', width: 'int') -> 'int'
Called by Textual to get the height of the content area. May be overridden in a subclass.
 
Args:
    container: Size of the container (immediate parent) widget.
    viewport: Size of the viewport.
    width: Width of renderable.
 
Returns:
    The height of the content.
get_content_width(self, container: 'Size', viewport: 'Size') -> 'int'
Called by textual to get the width of the content area. May be overridden in a subclass.
 
Args:
    container: Size of the container (immediate parent) widget.
    viewport: Size of the viewport.
 
Returns:
    The optimal width of the content.
get_loading_widget(self) -> 'Widget'
Get a widget to display a loading indicator.
 
The default implementation will defer to App.get_loading_widget.
 
Returns:
    A widget in place of this widget to indicate a loading.
get_pseudo_class_state(self) -> 'PseudoClasses'
Get an object describing whether each pseudo class is present on this object or not.
 
Returns:
    A PseudoClasses object describing the pseudo classes that are present.
get_pseudo_classes(self) -> 'Iterable[str]'
Pseudo classes for a widget.
 
Returns:
    Names of the pseudo classes.
get_style_at(self, x: 'int', y: 'int') -> 'Style'
Get the Rich style in a widget at a given relative offset.
 
Args:
    x: X coordinate relative to the widget.
    y: Y coordinate relative to the widget.
 
Returns:
    A rich Style object.
get_widget_by_id(self, id: 'str', expect_type: 'type[ExpectType] | None' = None) -> 'ExpectType | Widget'
Return the first descendant widget with the given ID.
 
Performs a depth-first search rooted at this widget.
 
Args:
    id: The ID to search for in the subtree.
    expect_type: Require the object be of the supplied type, or None for any type.
 
Returns:
    The first descendant encountered with this ID.
 
Raises:
    NoMatches: if no children could be found for this ID.
    WrongType: if the wrong type was found.
async handle_key(self, event: 'events.Key') -> 'bool'
mount(self, *widgets: 'Widget', before: 'int | str | Widget | None' = None, after: 'int | str | Widget | None' = None) -> 'AwaitMount'
Mount widgets below this widget (making this widget a container).
 
Args:
    *widgets: The widget(s) to mount.
    before: Optional location to mount before. An `int` is the index
        of the child to mount before, a `str` is a `query_one` query to
        find the widget to mount before.
    after: Optional location to mount after. An `int` is the index
        of the child to mount after, a `str` is a `query_one` query to
        find the widget to mount after.
 
Returns:
    An awaitable object that waits for widgets to be mounted.
 
Raises:
    MountError: If there is a problem with the mount request.
 
Note:
    Only one of ``before`` or ``after`` can be provided. If both are
    provided a ``MountError`` will be raised.
mount_all(self, widgets: 'Iterable[Widget]', *, before: 'int | str | Widget | None' = None, after: 'int | str | Widget | None' = None) -> 'AwaitMount'
Mount widgets from an iterable.
 
Args:
    widgets: An iterable of widgets.
    before: Optional location to mount before. An `int` is the index
        of the child to mount before, a `str` is a `query_one` query to
        find the widget to mount before.
    after: Optional location to mount after. An `int` is the index
        of the child to mount after, a `str` is a `query_one` query to
        find the widget to mount after.
 
Returns:
    An awaitable object that waits for widgets to be mounted.
 
Raises:
    MountError: If there is a problem with the mount request.
 
Note:
    Only one of ``before`` or ``after`` can be provided. If both are
    provided a ``MountError`` will be raised.
async mount_composed_widgets(self, widgets: 'list[Widget]') -> 'None'
Called by Textual to mount widgets after compose.
 
There is generally no need to implement this method in your application.
See [Lazy][textual.lazy.Lazy] for a class which uses this method to implement
*lazy* mounting.
 
Args:
    widgets: A list of child widgets.
move_child(self, child: 'int | Widget', *, before: 'int | Widget | None' = None, after: 'int | Widget | None' = None) -> 'None'
Move a child widget within its parent's list of children.
 
Args:
    child: The child widget to move.
    before: Child widget or location index to move before.
    after: Child widget or location index to move after.
 
Raises:
    WidgetError: If there is a problem with the child or target.
 
Note:
    Only one of `before` or `after` can be provided. If neither
    or both are provided a `WidgetError` will be raised.
notify(self, message: 'str', *, title: 'str' = '', severity: 'SeverityLevel' = 'information', timeout: 'float' = 5) -> 'None'
Create a notification.
 
!!! tip
 
    This method is thread-safe.
 
Args:
    message: The message for the notification.
    title: The title for the notification.
    severity: The severity of the notification.
    timeout: The timeout (in seconds) for the notification.
 
See [`App.notify`][textual.app.App.notify] for the full
documentation for this method.
notify_style_update(self) -> 'None'
Called after styles are updated.
 
Implement this in a subclass if you want to clear any cached data when the CSS is reloaded.
post_message(self, message: 'Message') -> 'bool'
Post a message to this widget.
 
Args:
    message: Message to post.
 
Returns:
    True if the message was posted, False if this widget was closed / closing.
post_render(self, renderable: 'RenderableType') -> 'ConsoleRenderable'
Applies style attributes to the default renderable.
 
Returns:
    A new renderable.
async recompose(self) -> 'None'
Recompose the widget.
 
Recomposing will remove children and call `self.compose` again to remount.
refresh(self, *regions: 'Region', repaint: 'bool' = True, layout: 'bool' = False, recompose: 'bool' = False) -> 'Self'
Initiate a refresh of the widget.
 
This method sets an internal flag to perform a refresh, which will be done on the
next idle event. Only one refresh will be done even if this method is called multiple times.
 
By default this method will cause the content of the widget to refresh, but not change its size. You can also
set `layout=True` to perform a layout.
 
!!! warning
 
    It is rarely necessary to call this method explicitly. Updating styles or reactive attributes will
    do this automatically.
 
Args:
    *regions: Additional screen regions to mark as dirty.
    repaint: Repaint the widget (will call render() again).
    layout: Also layout widgets in the view.
    recompose: Re-compose the widget (will remove and re-mount children).
 
Returns:
    The `Widget` instance.
release_mouse(self) -> 'None'
Release the mouse.
 
Mouse events will only be sent when the mouse is over the widget.
remove(self) -> 'AwaitRemove'
Remove the Widget from the DOM (effectively deleting it).
 
Returns:
    An awaitable object that waits for the widget to be removed.
remove_children(self, selector: 'str | type[QueryType]' = '*') -> 'AwaitRemove'
Remove the immediate children of this Widget from the DOM.
 
Args:
    selector: A CSS selector to specify which direct children to remove.
 
Returns:
    An awaitable object that waits for the direct children to be removed.
render_line(self, y: 'int') -> 'Strip'
Render a line of content.
 
Args:
    y: Y Coordinate of line.
 
Returns:
    A rendered line.
render_lines(self, crop: 'Region') -> 'list[Strip]'
Render the widget in to lines.
 
Args:
    crop: Region within visible area to render.
 
Returns:
    A list of list of segments.
render_str(self, text_content: 'str | Text') -> 'Text'
Convert str in to a Text object.
 
If you pass in an existing Text object it will be returned unaltered.
 
Args:
    text_content: Text or str.
 
Returns:
    A text object.
async run_action(self, action: 'str') -> 'None'
Perform a given action, with this widget as the default namespace.
 
Args:
    action: Action encoded as a string.
scroll_down(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll one line down.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if `animate` is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_end(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll to the end of the container.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if `animate` is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_home(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll to home position.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if animate is `True`; or `None` to use duration.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_left(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll one cell left.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if `animate` is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_page_down(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll one page down.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if animate is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_page_left(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll one page left.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if animate is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_page_right(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll one page right.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if animate is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_page_up(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll one page up.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if animate is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_relative(self, x: 'float | None' = None, y: 'float | None' = None, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll relative to current position.
 
Args:
    x: X distance (columns) to scroll, or ``None`` for no change.
    y: Y distance (rows) to scroll, or ``None`` for no change.
    animate: Animate to new scroll position.
    speed: Speed of scroll if `animate` is `True`. Or `None` to use `duration`.
    duration: Duration of animation, if animate is `True` and speed is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_right(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll one cell right.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if animate is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_to(self, x: 'float | None' = None, y: 'float | None' = None, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll to a given (absolute) coordinate, optionally animating.
 
Args:
    x: X coordinate (column) to scroll to, or `None` for no change.
    y: Y coordinate (row) to scroll to, or `None` for no change.
    animate: Animate to new scroll position.
    speed: Speed of scroll if `animate` is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
 
Note:
    The call to scroll is made after the next refresh.
scroll_to_center(self, widget: 'Widget', animate: 'bool' = True, *, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, origin_visible: 'bool' = True, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll this widget to the center of self.
 
The center of the widget will be scrolled to the center of the container.
 
Args:
    widget: The widget to scroll to the center of self.
    animate: Whether to animate the scroll.
    speed: Speed of scroll if animate is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    origin_visible: Ensure that the top left corner of the widget remains visible after the scroll.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_to_region(self, region: 'Region', *, spacing: 'Spacing | None' = None, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, center: 'bool' = False, top: 'bool' = False, origin_visible: 'bool' = True, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'Offset'
Scrolls a given region in to view, if required.
 
This method will scroll the least distance required to move `region` fully within
the scrollable area.
 
Args:
    region: A region that should be visible.
    spacing: Optional spacing around the region.
    animate: `True` to animate, or `False` to jump.
    speed: Speed of scroll if `animate` is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    top: Scroll `region` to top of container.
    origin_visible: Ensure that the top left of the widget is within the window.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
 
Returns:
    The distance that was scrolled.
scroll_to_widget(self, widget: 'Widget', *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, center: 'bool' = False, top: 'bool' = False, origin_visible: 'bool' = True, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'bool'
Scroll scrolling to bring a widget in to view.
 
Args:
    widget: A descendant widget.
    animate: `True` to animate, or `False` to jump.
    speed: Speed of scroll if `animate` is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    easing: An easing method for the scrolling animation.
    top: Scroll widget to top of container.
    origin_visible: Ensure that the top left of the widget is within the window.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
 
Returns:
    `True` if any scrolling has occurred in any descendant, otherwise `False`.
scroll_up(self, *, animate: 'bool' = True, speed: 'float | None' = None, duration: 'float | None' = None, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll one line up.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if `animate` is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and speed is `None`.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
scroll_visible(self, animate: 'bool' = True, *, speed: 'float | None' = None, duration: 'float | None' = None, top: 'bool' = False, easing: 'EasingFunction | str | None' = None, force: 'bool' = False, on_complete: 'CallbackType | None' = None, level: 'AnimationLevel' = 'basic') -> 'None'
Scroll the container to make this widget visible.
 
Args:
    animate: Animate scroll.
    speed: Speed of scroll if animate is `True`; or `None` to use `duration`.
    duration: Duration of animation, if `animate` is `True` and `speed` is `None`.
    top: Scroll to top of container.
    easing: An easing method for the scrolling animation.
    force: Force scrolling even when prohibited by overflow styling.
    on_complete: A callable to invoke when the animation is finished.
    level: Minimum level required for the animation to take place (inclusive).
set_loading(self, loading: 'bool') -> 'Awaitable'
Set or reset the loading state of this widget.
 
A widget in a loading state will display a LoadingIndicator that obscures the widget.
 
Args:
    loading: `True` to put the widget into a loading state, or `False` to reset the loading state.
 
Returns:
    An optional awaitable.
async stop_animation(self, attribute: 'str', complete: 'bool' = True) -> 'None'
Stop an animation on an attribute.
 
Args:
    attribute: Name of the attribute whose animation should be stopped.
    complete: Should the animation be set to its final value?
 
Note:
    If there is no animation scheduled or running, this is a no-op.
validate_scroll_target_x(self, value: 'float') -> 'float'
validate_scroll_target_y(self, value: 'float') -> 'float'
validate_scroll_x(self, value: 'float') -> 'float'
validate_scroll_y(self, value: 'float') -> 'float'
watch_disabled(self) -> 'None'
Update the styles of the widget and its children when disabled is toggled.
watch_has_focus(self, value: 'bool') -> 'None'
Update from CSS if has focus state changes.
watch_hover_style(self, previous_hover_style: 'Style', hover_style: 'Style') -> 'None'
watch_mouse_over(self, value: 'bool') -> 'None'
Update from CSS if mouse over state changes.
watch_scroll_x(self, old_value: 'float', new_value: 'float') -> 'None'
watch_scroll_y(self, old_value: 'float', new_value: 'float') -> 'None'

Class methods inherited from textual.widget.Widget:
__init_subclass__(can_focus: 'bool | None' = None, can_focus_children: 'bool | None' = None, inherit_css: 'bool' = True, inherit_bindings: 'bool' = True) -> 'None' from textual.message_pump._MessagePumpMeta
This method is called when a class is subclassed.
 
The default implementation does nothing. It may be
overridden to extend subclasses.

Readonly properties inherited from textual.widget.Widget:
allow_horizontal_scroll
Check if horizontal scroll is permitted.
 
May be overridden if you want different logic regarding allowing scrolling.
allow_vertical_scroll
Check if vertical scroll is permitted.
 
May be overridden if you want different logic regarding allowing scrolling.
container_size
The size of the container (parent widget).
 
Returns:
    Container size.
container_viewport
The viewport region (parent window).
 
Returns:
    The region that contains this widget.
content_offset
An offset from the Widget origin where the content begins.
 
Returns:
    Offset from widget's origin.
content_region
Gets an absolute region containing the content (minus padding and border).
 
Returns:
    Screen region that contains a widget's content.
content_size
The size of the content area.
 
Returns:
    Content area size.
dock_gutter
Space allocated to docks in the parent.
 
Returns:
    Space to be subtracted from scrollable area.
focusable
Can this widget currently be focused?
gutter
Spacing for padding / border / scrollbars.
 
Returns:
    Additional spacing around content area.
horizontal_scrollbar
The horizontal scrollbar.
 
Note:
    This will *create* a scrollbar if one doesn't exist.
 
Returns:
    ScrollBar Widget.
is_container
Is this widget a container (contains other widgets)?
is_horizontal_scroll_end
Is the horizontal scroll position at the maximum?
is_horizontal_scrollbar_grabbed
Is the user dragging the vertical scrollbar?
is_mounted
Check if this widget is mounted.
is_scrollable
Can this widget be scrolled?
is_vertical_scroll_end
Is the vertical scroll position at the maximum?
is_vertical_scrollbar_grabbed
Is the user dragging the vertical scrollbar?
layer
Get the name of this widgets layer.
 
Returns:
    Name of layer.
layers
Layers of from parent.
 
Returns:
    Tuple of layer names.
link_style
Style of links.
 
Returns:
    Rich style.
link_style_hover
Style of links underneath the mouse cursor.
 
Returns:
    Rich Style.
max_scroll_x
The maximum value of `scroll_x`.
max_scroll_y
The maximum value of `scroll_y`.
opacity
Total opacity of widget.
outer_size
The size of the widget (including padding and border).
 
Returns:
    Outer size.
region
The region occupied by this widget, relative to the Screen.
 
Raises:
    NoScreen: If there is no screen.
    errors.NoWidget: If the widget is not on the screen.
 
Returns:
    Region within screen occupied by widget.
scroll_offset
Get the current scroll offset.
 
Returns:
    Offset a container has been scrolled by.
scrollable_content_region
Gets an absolute region containing the scrollable content (minus padding, border, and scrollbars).
 
Returns:
    Screen region that contains a widget's content.
scrollbar_corner
The scrollbar corner.
 
Note:
    This will *create* a scrollbar corner if one doesn't exist.
 
Returns:
    ScrollBarCorner Widget.
scrollbar_gutter
Spacing required to fit scrollbar(s).
 
Returns:
    Scrollbar gutter spacing.
scrollbar_size_horizontal
Get the height used by the *horizontal* scrollbar.
 
Returns:
    Number of rows in the horizontal scrollbar.
scrollbar_size_vertical
Get the width used by the *vertical* scrollbar.
 
Returns:
    Number of columns in the vertical scrollbar.
scrollbars_enabled
A tuple of booleans that indicate if scrollbars are enabled.
 
Returns:
    A tuple of (<vertical scrollbar enabled>, <horizontal scrollbar enabled>)
scrollbars_space
The number of cells occupied by scrollbars for width and height
siblings
Get the widget's siblings (self is removed from the return list).
 
Returns:
    A list of siblings.
size
The size of the content area.
 
Returns:
    Content area size.
vertical_scrollbar
The vertical scrollbar (create if necessary).
 
Note:
    This will *create* a scrollbar if one doesn't exist.
 
Returns:
    ScrollBar Widget.
virtual_region
The widget region relative to it's container (which may not be visible,
depending on scroll offset).
 
 
Returns:
    The virtual region.
virtual_region_with_margin
The widget region relative to its container (*including margin*), which may not be visible,
depending on the scroll offset.
 
Returns:
    The virtual region of the Widget, inclusive of its margin.
visible_siblings
A list of siblings which will be shown.
 
Returns:
    List of siblings.
window_region
The region within the scrollable area that is currently visible.
 
Returns:
    New region.

Data descriptors inherited from textual.widget.Widget:
auto_links
border_subtitle
border_title
disabled
expand
has_focus
highlight_link_id
hover_style
loading
mouse_over
offset
Widget offset from origin.
 
Returns:
    Relative offset.
scroll_target_x
scroll_target_y
scroll_x
scroll_y
show_horizontal_scrollbar
show_vertical_scrollbar
shrink
tooltip
Tooltip for the widget, or `None` for no tooltip.
virtual_size

Data and other attributes inherited from textual.widget.Widget:
BORDER_SUBTITLE = ''
BORDER_TITLE = ''
COMPONENT_CLASSES = set()
ExpectType = ~ExpectType

Methods inherited from textual.dom.DOMNode:
async action_toggle(self, attribute_name: 'str') -> 'None'
Toggle an attribute on the node.
 
Assumes the attribute is a bool.
 
Args:
    attribute_name: Name of the attribute.
add_class(self, *class_names: 'str', update: 'bool' = True) -> 'Self'
Add class names to this Node.
 
Args:
    *class_names: CSS class names to add.
    update: Also update styles.
 
Returns:
    Self.
data_bind(self, *reactives: 'Reactive[Any]', **bind_vars: 'Reactive[Any] | object') -> 'Self'
Bind reactive data so that changes to a reactive automatically change the reactive on another widget.
 
Reactives may be given as positional arguments or keyword arguments.
See the [guide on data binding](/guide/reactivity#data-binding).
 
Example:
    ```python
    def compose(self) -> ComposeResult:
        yield WorldClock("Europe/London").data_bind(WorldClockApp.time)
        yield WorldClock("Europe/Paris").data_bind(WorldClockApp.time)
        yield WorldClock("Asia/Tokyo").data_bind(WorldClockApp.time)
    ```
 
Raises:
    ReactiveError: If the data wasn't bound.
 
Returns:
    Self.
get_component_styles(self, name: 'str') -> 'RenderStyles'
Get a "component" styles object (must be defined in COMPONENT_CLASSES classvar).
 
Args:
    name: Name of the component.
 
Raises:
    KeyError: If the component class doesn't exist.
 
Returns:
    A Styles object.
has_class(self, *class_names: 'str') -> 'bool'
Check if the Node has all the given class names.
 
Args:
    *class_names: CSS class names to check.
 
Returns:
    ``True`` if the node has all the given class names, otherwise ``False``.
has_pseudo_class(self, class_name: 'str') -> 'bool'
Check the node has the given pseudo class.
 
Args:
    class_name: The pseudo class to check for.
 
Returns:
    `True` if the DOM node has the pseudo class, `False` if not.
has_pseudo_classes(self, class_names: 'set[str]') -> 'bool'
Check the node has all the given pseudo classes.
 
Args:
    class_names: Set of class names to check for.
 
Returns:
    `True` if all pseudo class names are present.
query(self, selector: 'str | type[QueryType] | None' = None) -> 'DOMQuery[Widget] | DOMQuery[QueryType]'
Query the DOM for children that match a selector or widget type.
 
Args:
    selector: A CSS selector, widget type, or `None` for all nodes.
 
Returns:
    A query object.
query_one(self, selector: 'str | type[QueryType]', expect_type: 'type[QueryType] | None' = None) -> 'QueryType | Widget'
Get a widget from this widget's children that matches a selector or widget type.
 
Args:
    selector: A selector or widget type.
    expect_type: Require the object be of the supplied type, or None for any type.
 
Raises:
    WrongType: If the wrong type was found.
    NoMatches: If no node matches the query.
    TooManyMatches: If there is more than one matching node in the query.
 
Returns:
    A widget matching the selector.
remove_class(self, *class_names: 'str', update: 'bool' = True) -> 'Self'
Remove class names from this Node.
 
Args:
    *class_names: CSS class names to remove.
    update: Also update styles.
 
Returns:
    Self.
reset_styles(self) -> 'None'
Reset styles back to their initial state.
run_worker(self, work: 'WorkType[ResultType]', name: 'str | None' = '', group: 'str' = 'default', description: 'str' = '', exit_on_error: 'bool' = True, start: 'bool' = True, exclusive: 'bool' = False, thread: 'bool' = False) -> 'Worker[ResultType]'
Run work in a worker.
 
A worker runs a function, coroutine, or awaitable, in the *background* as an async task or as a thread.
 
Args:
    work: A function, async function, or an awaitable object to run in a worker.
    name: A short string to identify the worker (in logs and debugging).
    group: A short string to identify a group of workers.
    description: A longer string to store longer information on the worker.
    exit_on_error: Exit the app if the worker raises an error. Set to `False` to suppress exceptions.
    start: Start the worker immediately.
    exclusive: Cancel all workers in the same group.
    thread: Mark the worker as a thread worker.
 
Returns:
    New Worker instance.
set_class(self, add: 'bool', *class_names: 'str', update: 'bool' = True) -> 'Self'
Add or remove class(es) based on a condition.
 
Args:
    add: Add the classes if True, otherwise remove them.
    update: Also update styles.
 
Returns:
    Self.
set_classes(self, classes: 'str | Iterable[str]') -> 'Self'
Replace all classes.
 
Args:
    classes: A string containing space separated classes, or an
        iterable of class names.
 
Returns:
    Self.
set_reactive(self, reactive: 'Reactive[ReactiveType]', value: 'ReactiveType') -> 'None'
Sets a reactive value *without* invoking validators or watchers.
 
Example:
    ```python
    self.set_reactive(App.dark_mode, True)
    ```
 
Args:
    name: Name of reactive attribute.
    value: New value of reactive.
 
Raises:
    AttributeError: If the first argument is not a reactive.
set_styles(self, css: 'str | None' = None, **update_styles: 'Any') -> 'Self'
Set custom styles on this object.
 
Args:
    css: Styles in CSS format.
    update_styles: Keyword arguments map style names onto style values.
 
Returns:
    Self.
sort_children(self, *, key: 'Callable[[Widget], SupportsRichComparison] | None' = None, reverse: 'bool' = False) -> 'None'
Sort child widgets with an optional key function.
 
If `key` is not provided then widgets will be sorted in the order they are constructed.
 
Example:
    ```python
    # Sort widgets by name
    screen.sort_children(key=lambda widget: widget.name or "")
    ```
 
Args:
    key: A callable which accepts a widget and returns something that can be sorted,
        or `None` to sort without a key function.
    reverse: Sort in descending order.
toggle_class(self, *class_names: 'str') -> 'Self'
Toggle class names on this Node.
 
Args:
    *class_names: CSS class names to toggle.
 
Returns:
    Self.
walk_children(self, filter_type: 'type[WalkType] | None' = None, *, with_self: 'bool' = False, method: 'WalkMethod' = 'depth', reverse: 'bool' = False) -> 'list[DOMNode] | list[WalkType]'
Walk the subtree rooted at this node, and return every descendant encountered in a list.
 
Args:
    filter_type: Filter only this type, or None for no filter.
    with_self: Also yield self in addition to descendants.
    method: One of "depth" or "breadth".
    reverse: Reverse the order (bottom up).
 
Returns:
    A list of nodes.
watch(self, obj: 'DOMNode', attribute_name: 'str', callback: 'WatchCallbackType', init: 'bool' = True) -> 'None'
Watches for modifications to reactive attributes on another object.
 
Example:
 
    Here's how you could detect when the app changes from dark to light mode (and vice versa).
 
    ```python
    def on_dark_change(old_value:bool, new_value:bool):
        # Called when app.dark changes.
        print("App.dark when from {old_value} to {new_value}")
 
    self.watch(self.app, "dark", self.on_dark_change, init=False)
    ```
 
Args:
    obj: Object containing attribute to watch.
    attribute_name: Attribute to watch.
    callback: A callback to run when attribute changes.
    init: Check watchers on first call.

Readonly properties inherited from textual.dom.DOMNode:
ancestors
A list of ancestor nodes found by tracing a path all the way back to App.
 
Returns:
    A list of nodes.
ancestors_with_self
A list of ancestor nodes found by tracing a path all the way back to App.
 
Note:
    This is inclusive of ``self``.
 
Returns:
    A list of nodes.
background_colors
The background color and the color of the parent's background.
 
Returns:
    `(<background color>, <color>)`
children
A view on to the children.
 
Returns:
    The node's children.
colors
The widget's background and foreground colors, and the parent's background and foreground colors.
 
Returns:
    `(<parent background>, <parent color>, <background>, <color>)`
css_identifier
A CSS selector that identifies this DOM node.
css_identifier_styled
A syntax highlighted CSS identifier.
 
Returns:
    A Rich Text object.
css_path_nodes
A list of nodes from the App to this node, forming a "path".
 
Returns:
    A list of nodes, where the first item is the App, and the last is this node.
css_tree
A Rich tree to display the DOM, annotated with the node's CSS.
 
Log this to visualize your app in the textual console.
 
Example:
    ```python
    self.log(self.css_tree)
    ```
 
Returns:
    A Tree renderable.
displayed_children
The child nodes which will be displayed.
 
Returns:
    A list of nodes.
is_modal
Is the node a modal?
name
The name of the node.
parent
The parent node.
 
All nodes have parent once added to the DOM, with the exception of the App which is the *root* node.
pseudo_classes
A (frozen) set of all pseudo classes.
rich_style
Get a Rich Style object for this DOMNode.
 
Returns:
    A Rich style.
screen
The screen containing this node.
 
Returns:
    A screen object.
 
Raises:
    NoScreen: If this node isn't mounted (and has no screen).
text_style
Get the text style object.
 
A widget's style is influenced by its parent. for instance if a parent is bold, then
the child will also be bold.
 
Returns:
    A Rich Style.
tree
A Rich tree to display the DOM.
 
Log this to visualize your app in the textual console.
 
Example:
    ```python
    self.log(self.tree)
    ```
 
Returns:
    A Tree renderable.
workers
The app's worker manager. Shortcut for `self.app.workers`.

Data descriptors inherited from textual.dom.DOMNode:
auto_refresh
Number of seconds between automatic refresh, or `None` for no automatic refresh.
classes
display
Should the DOM node be displayed?
 
May be set to a boolean to show or hide the node, or to any valid value for the `display` rule.
 
Example:
    ```python
    my_widget.display = False  # Hide my_widget
    ```
id
The ID of this node, or None if the node has no ID.
visible
Is this widget visible in the DOM?
 
If a widget hasn't had its visibility set explicitly, then it inherits it from its
DOM ancestors.
 
This may be set explicitly to override inherited values.
The valid values include the valid values for the `visibility` rule and the booleans
`True` or `False`, to set the widget to be visible or invisible, respectively.
 
When a node is invisible, Textual will reserve space for it, but won't display anything.

Data and other attributes inherited from textual.dom.DOMNode:
BINDINGS = []
DEFAULT_CLASSES = ''
SCOPED_CSS = True
WalkType = ~WalkType

Methods inherited from textual.message_pump.MessagePump:
call_after_refresh(self, callback: 'Callback', *args: 'Any', **kwargs: 'Any') -> 'bool'
Schedule a callback to run after all messages are processed and the screen
has been refreshed. Positional and keyword arguments are passed to the callable.
 
Args:
    callback: A callable.
 
Returns:
    `True` if the callback was scheduled, or `False` if the callback could not be
        scheduled (may occur if the message pump was closed or closing).
call_later(self, callback: 'Callback', *args: 'Any', **kwargs: 'Any') -> 'bool'
Schedule a callback to run after all messages are processed in this object.
Positional and keywords arguments are passed to the callable.
 
Args:
    callback: Callable to call next.
    *args: Positional arguments to pass to the callable.
    **kwargs: Keyword arguments to pass to the callable.
 
Returns:
    `True` if the callback was scheduled, or `False` if the callback could not be
        scheduled (may occur if the message pump was closed or closing).
call_next(self, callback: 'Callback', *args: 'Any', **kwargs: 'Any') -> 'None'
Schedule a callback to run immediately after processing the current message.
 
Args:
    callback: Callable to run after current event.
    *args: Positional arguments to pass to the callable.
    **kwargs: Keyword arguments to pass to the callable.
check_idle(self) -> 'None'
Prompt the message pump to call idle if the queue is empty.
disable_messages(self, *messages: 'type[Message]') -> 'None'
Disable message types from being processed.
async dispatch_key(self, event: 'events.Key') -> 'bool'
Dispatch a key event to method.
 
This method will call the method named 'key_<event.key>' if it exists.
Some keys have aliases. The first alias found will be invoked if it exists.
If multiple handlers exist that match the key, an exception is raised.
 
Args:
    event: A key event.
 
Returns:
    True if key was handled, otherwise False.
 
Raises:
    DuplicateKeyHandlers: When there's more than 1 handler that could handle this key.
enable_messages(self, *messages: 'type[Message]') -> 'None'
Enable processing of messages types.
async on_callback(self, event: 'events.Callback') -> 'None'
async on_event(self, event: 'events.Event') -> 'None'
Called to process an event.
 
Args:
    event: An Event object.
async on_timer(self, event: 'events.Timer') -> 'None'
prevent(self, *message_types: 'type[Message]') -> 'Generator[None, None, None]'
A context manager to *temporarily* prevent the given message types from being posted.
 
Example:
    ```python
    input = self.query_one(Input)
    with self.prevent(Input.Changed):
        input.value = "foo"
    ```
set_interval(self, interval: 'float', callback: 'TimerCallback | None' = None, *, name: 'str | None' = None, repeat: 'int' = 0, pause: 'bool' = False) -> 'Timer'
Call a function at periodic intervals.
 
Args:
    interval: Time (in seconds) between calls.
    callback: Function to call.
    name: Name of the timer object.
    repeat: Number of times to repeat the call or 0 for continuous.
    pause: Start the timer paused.
 
Returns:
    A timer object.
set_timer(self, delay: 'float', callback: 'TimerCallback | None' = None, *, name: 'str | None' = None, pause: 'bool' = False) -> 'Timer'
Make a function call after a delay.
 
Args:
    delay: Time (in seconds) to wait before invoking callback.
    callback: Callback to call after time has expired.
    name: Name of the timer (for debug).
    pause: Start timer paused.
 
Returns:
    A timer object.

Readonly properties inherited from textual.message_pump.MessagePump:
app
Get the current app.
 
Returns:
    The current app.
 
Raises:
    NoActiveAppError: if no active app could be found for the current asyncio context
has_parent
Does this object have a parent?
is_attached
Is the node attached to the app via the DOM?
is_parent_active
Is the parent active?
is_running
Is the message pump running (potentially processing messages)?
log
Get a logger for this object.
 
Returns:
    A logger.
message_queue_size
The current size of the message queue.
task

Data descriptors inherited from textual.message_pump.MessagePump:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class ChannelEnvironmentSource(enum.StrEnum)
    ChannelEnvironmentSource(*values)
 
Possible sources of channel environments.
 
 
Method resolution order:
ChannelEnvironmentSource
enum.StrEnum
builtins.str
enum.ReprEnum
enum.Enum
builtins.object

Methods defined here:
__format__(self, format_spec, /)
Return a formatted version of the string as described by format_spec.
__new__(cls, value)
Create and return a new object.  See help(type) for accurate signature.
__str__(self, /)
Return str(self).

Data and other attributes defined here:
CONNECTION_LOCAL = <ChannelEnvironmentSource.CONNECTION_LOCAL: 'local connection'>
CONNECTION_REMOTE = <ChannelEnvironmentSource.CONNECTION_REMOTE: 'remote connection'>
TASK = <ChannelEnvironmentSource.TASK: 'task'>

Methods inherited from enum.StrEnum:
__repr__(self)
Return repr(self).

Methods inherited from builtins.str:
__add__(self, value, /)
Return self+value.
__contains__(self, key, /)
Return bool(key in self).
__eq__(self, value, /)
Return self==value.
__ge__(self, value, /)
Return self>=value.
__getattribute__(self, name, /)
Return getattr(self, name).
__getitem__(self, key, /)
Return self[key].
__getnewargs__(...)
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__iter__(self, /)
Implement iter(self).
__le__(self, value, /)
Return self<=value.
__len__(self, /)
Return len(self).
__lt__(self, value, /)
Return self<value.
__mod__(self, value, /)
Return self%value.
__mul__(self, value, /)
Return self*value.
__ne__(self, value, /)
Return self!=value.
__rmod__(self, value, /)
Return value%self.
__rmul__(self, value, /)
Return value*self.
__sizeof__(self, /)
Return the size of the string in memory, in bytes.
capitalize(self, /)
Return a capitalized version of the string.
 
More specifically, make the first character have upper case and the rest lower
case.
casefold(self, /)
Return a version of the string suitable for caseless comparisons.
center(self, width, fillchar=' ', /)
Return a centered string of length width.
 
Padding is done using the specified fill character (default is a space).
count(...)
S.count(sub[, start[, end]]) -> int
 
Return the number of non-overlapping occurrences of substring sub in
string S[start:end].  Optional arguments start and end are
interpreted as in slice notation.
encode(self, /, encoding='utf-8', errors='strict')
Encode the string using the codec registered for encoding.
 
encoding
  The encoding in which to encode the string.
errors
  The error handling scheme to use for encoding errors.
  The default is 'strict' meaning that encoding errors raise a
  UnicodeEncodeError.  Other possible values are 'ignore', 'replace' and
  'xmlcharrefreplace' as well as any other name registered with
  codecs.register_error that can handle UnicodeEncodeErrors.
endswith(...)
S.endswith(suffix[, start[, end]]) -> bool
 
Return True if S ends with the specified suffix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
suffix can also be a tuple of strings to try.
expandtabs(self, /, tabsize=8)
Return a copy where all tab characters are expanded using spaces.
 
If tabsize is not given, a tab size of 8 characters is assumed.
find(...)
S.find(sub[, start[, end]]) -> int
 
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
format(...)
S.format(*args, **kwargs) -> str
 
Return a formatted version of S, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}').
format_map(...)
S.format_map(mapping) -> str
 
Return a formatted version of S, using substitutions from mapping.
The substitutions are identified by braces ('{' and '}').
index(...)
S.index(sub[, start[, end]]) -> int
 
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Raises ValueError when the substring is not found.
isalnum(self, /)
Return True if the string is an alpha-numeric string, False otherwise.
 
A string is alpha-numeric if all characters in the string are alpha-numeric and
there is at least one character in the string.
isalpha(self, /)
Return True if the string is an alphabetic string, False otherwise.
 
A string is alphabetic if all characters in the string are alphabetic and there
is at least one character in the string.
isascii(self, /)
Return True if all characters in the string are ASCII, False otherwise.
 
ASCII characters have code points in the range U+0000-U+007F.
Empty string is ASCII too.
isdecimal(self, /)
Return True if the string is a decimal string, False otherwise.
 
A string is a decimal string if all characters in the string are decimal and
there is at least one character in the string.
isdigit(self, /)
Return True if the string is a digit string, False otherwise.
 
A string is a digit string if all characters in the string are digits and there
is at least one character in the string.
isidentifier(self, /)
Return True if the string is a valid Python identifier, False otherwise.
 
Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
such as "def" or "class".
islower(self, /)
Return True if the string is a lowercase string, False otherwise.
 
A string is lowercase if all cased characters in the string are lowercase and
there is at least one cased character in the string.
isnumeric(self, /)
Return True if the string is a numeric string, False otherwise.
 
A string is numeric if all characters in the string are numeric and there is at
least one character in the string.
isprintable(self, /)
Return True if the string is printable, False otherwise.
 
A string is printable if all of its characters are considered printable in
repr() or if it is empty.
isspace(self, /)
Return True if the string is a whitespace string, False otherwise.
 
A string is whitespace if all characters in the string are whitespace and there
is at least one character in the string.
istitle(self, /)
Return True if the string is a title-cased string, False otherwise.
 
In a title-cased string, upper- and title-case characters may only
follow uncased characters and lowercase characters only cased ones.
isupper(self, /)
Return True if the string is an uppercase string, False otherwise.
 
A string is uppercase if all cased characters in the string are uppercase and
there is at least one cased character in the string.
join(self, iterable, /)
Concatenate any number of strings.
 
The string whose method is called is inserted in between each given string.
The result is returned as a new string.
 
Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
ljust(self, width, fillchar=' ', /)
Return a left-justified string of length width.
 
Padding is done using the specified fill character (default is a space).
lower(self, /)
Return a copy of the string converted to lowercase.
lstrip(self, chars=None, /)
Return a copy of the string with leading whitespace removed.
 
If chars is given and not None, remove characters in chars instead.
partition(self, sep, /)
Partition the string into three parts using the given separator.
 
This will search for the separator in the string.  If the separator is found,
returns a 3-tuple containing the part before the separator, the separator
itself, and the part after it.
 
If the separator is not found, returns a 3-tuple containing the original string
and two empty strings.
removeprefix(self, prefix, /)
Return a str with the given prefix string removed if present.
 
If the string starts with the prefix string, return string[len(prefix):].
Otherwise, return a copy of the original string.
removesuffix(self, suffix, /)
Return a str with the given suffix string removed if present.
 
If the string ends with the suffix string and that suffix is not empty,
return string[:-len(suffix)]. Otherwise, return a copy of the original
string.
replace(self, old, new, count=-1, /)
Return a copy with all occurrences of substring old replaced by new.
 
  count
    Maximum number of occurrences to replace.
    -1 (the default value) means replace all occurrences.
 
If the optional argument count is given, only the first count occurrences are
replaced.
rfind(...)
S.rfind(sub[, start[, end]]) -> int
 
Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
rindex(...)
S.rindex(sub[, start[, end]]) -> int
 
Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end].  Optional
arguments start and end are interpreted as in slice notation.
 
Raises ValueError when the substring is not found.
rjust(self, width, fillchar=' ', /)
Return a right-justified string of length width.
 
Padding is done using the specified fill character (default is a space).
rpartition(self, sep, /)
Partition the string into three parts using the given separator.
 
This will search for the separator in the string, starting at the end. If
the separator is found, returns a 3-tuple containing the part before the
separator, the separator itself, and the part after it.
 
If the separator is not found, returns a 3-tuple containing two empty strings
and the original string.
rsplit(self, /, sep=None, maxsplit=-1)
Return a list of the substrings in the string, using sep as the separator string.
 
  sep
    The separator used to split the string.
 
    When set to None (the default value), will split on any whitespace
    character (including \n \r \t \f and spaces) and will discard
    empty strings from the result.
  maxsplit
    Maximum number of splits.
    -1 (the default value) means no limit.
 
Splitting starts at the end of the string and works to the front.
rstrip(self, chars=None, /)
Return a copy of the string with trailing whitespace removed.
 
If chars is given and not None, remove characters in chars instead.
split(self, /, sep=None, maxsplit=-1)
Return a list of the substrings in the string, using sep as the separator string.
 
  sep
    The separator used to split the string.
 
    When set to None (the default value), will split on any whitespace
    character (including \n \r \t \f and spaces) and will discard
    empty strings from the result.
  maxsplit
    Maximum number of splits.
    -1 (the default value) means no limit.
 
Splitting starts at the front of the string and works to the end.
 
Note, str.split() is mainly useful for data that has been intentionally
delimited.  With natural text that includes punctuation, consider using
the regular expression module.
splitlines(self, /, keepends=False)
Return a list of the lines in the string, breaking at line boundaries.
 
Line breaks are not included in the resulting list unless keepends is given and
true.
startswith(...)
S.startswith(prefix[, start[, end]]) -> bool
 
Return True if S starts with the specified prefix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
prefix can also be a tuple of strings to try.
strip(self, chars=None, /)
Return a copy of the string with leading and trailing whitespace removed.
 
If chars is given and not None, remove characters in chars instead.
swapcase(self, /)
Convert uppercase characters to lowercase and lowercase characters to uppercase.
title(self, /)
Return a version of the string where each word is titlecased.
 
More specifically, words start with uppercased characters and all remaining
cased characters have lower case.
translate(self, table, /)
Replace each character in the string using the given translation table.
 
  table
    Translation table, which must be a mapping of Unicode ordinals to
    Unicode ordinals, strings, or None.
 
The table must implement lookup/indexing via __getitem__, for instance a
dictionary or list.  If this operation raises LookupError, the character is
left untouched.  Characters mapped to None are deleted.
upper(self, /)
Return a copy of the string converted to uppercase.
zfill(self, width, /)
Pad a numeric string with zeros on the left, to fill a field of the given width.
 
The string is never truncated.

Static methods inherited from builtins.str:
maketrans(...)
Return a translation table usable for str.translate().
 
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters to Unicode ordinals, strings or None.
Character keys will be then converted to ordinals.
If there are two arguments, they must be strings of equal length, and
in the resulting dictionary, each character in x will be mapped to the
character at the same position in y. If there is a third argument, it
must be a string, whose characters will be mapped to None in the result.

Methods inherited from enum.Enum:
__dir__(self)
Returns public methods and other interesting attributes.
__init__(self, *args, **kwds)
Initialize self.  See help(type(self)) for accurate signature.
__reduce_ex__(self, proto)
Helper for pickle.

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Readonly properties inherited from enum.EnumType:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
Functions
       
async test(app: runtimepy.net.arbiter.info.AppInfo) -> int
Run a textual application.

 
Data
        __all__ = ['Base', 'test', 'ChannelEnvironmentDisplay', 'ChannelEnvironmentSource']