tessl install tessl/pypi-textual@6.1.0Modern Text User Interface framework for building cross-platform terminal and web applications with Python
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.18x
Baseline
Agent success rate without this tile
79%
Build a customizable status card widget for a terminal application that displays status information with dynamic styling based on status type.
Create a Python module that implements a status card widget with the following features:
The widget should display status information in a card format with:
The widget must support different visual styles based on the status type:
Success status:
Warning status:
Error status:
Info status:
The widget must be able to change its status type at runtime, with the styling updating automatically to reflect the new status.
@generates
from textual.app import App
from textual.widget import Widget
class StatusCard(Widget):
"""A customizable status card widget with dynamic styling."""
def __init__(self, title: str, message: str, status: str = "info") -> None:
"""
Initialize the status card.
Args:
title: The title text to display
message: The status message to display
status: The status type ("success", "warning", "error", or "info")
"""
pass
def set_status(self, status: str) -> None:
"""
Change the status type, updating the styling accordingly.
Args:
status: The new status type ("success", "warning", "error", or "info")
"""
passProvides the TUI framework with CSS-like styling capabilities.