Skip to content

Commit f84be7e

Browse files
committed
chore: remove log add feature
1 parent 5a7d50f commit f84be7e

File tree

2 files changed

+4
-55
lines changed

2 files changed

+4
-55
lines changed

src/ai/backend/install/app.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ def compose(self) -> ComposeResult:
5858
yield Label("Development Setup", classes="mode-title")
5959
with TabbedContent():
6060
with TabPane("Install Log", id="tab-dev-log"):
61-
yield SetupLog(
62-
wrap=True,
63-
classes="log",
64-
non_interactive=self._non_interactive,
65-
)
61+
yield SetupLog(wrap=True, classes="log")
6662
with TabPane("Install Report", id="tab-dev-report"):
6763
yield Label("Installation is not complete.")
6864

@@ -119,11 +115,7 @@ def compose(self) -> ComposeResult:
119115
yield Label("Package Setup", classes="mode-title")
120116
with TabbedContent():
121117
with TabPane("Install Log", id="tab-pkg-log"):
122-
yield SetupLog(
123-
wrap=True,
124-
classes="log",
125-
non_interactive=self._non_interactive,
126-
)
118+
yield SetupLog(wrap=True, classes="log")
127119
with TabPane("Install Report", id="tab-pkg-report"):
128120
yield Label("Installation is not complete.")
129121

src/ai/backend/install/widgets.py

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import asyncio
44
from pathlib import Path
55

6-
from rich.console import Console, ConsoleRenderable
6+
from rich.console import ConsoleRenderable
77
from rich.text import Text
8-
from rich.traceback import Traceback
98
from textual import on
109
from textual.app import ComposeResult
1110
from textual.binding import Binding
@@ -45,51 +44,9 @@ class SetupLog(RichLog):
4544
Binding("enter", "continue", show=False),
4645
]
4746

48-
def __init__(
49-
self,
50-
*args,
51-
non_interactive: bool = False,
52-
**kwargs,
53-
) -> None:
47+
def __init__(self, *args, **kwargs) -> None:
5448
super().__init__(*args, **kwargs)
5549
self._continue = asyncio.Event()
56-
self._non_interactive = non_interactive
57-
self._stdout_console: Console | None = None
58-
if self._non_interactive:
59-
self._stdout_console = Console(force_terminal=True)
60-
61-
def _write_to_stdout(self, content: object) -> None:
62-
"""Write content to stdout via Rich Console."""
63-
if self._stdout_console is None:
64-
return
65-
try:
66-
if isinstance(content, (str, Text, Traceback)):
67-
self._stdout_console.print(content)
68-
elif isinstance(content, Exception):
69-
self._stdout_console.print(f"[red]Error: {content}[/red]")
70-
self._stdout_console.print_exception()
71-
else:
72-
self._stdout_console.print(content)
73-
except Exception:
74-
pass
75-
76-
def write(
77-
self,
78-
content: object,
79-
width: int | None = None,
80-
expand: bool = False,
81-
shrink: bool = True,
82-
scroll_end: bool | None = None,
83-
) -> SetupLog:
84-
"""Write content to the log and optionally to stdout."""
85-
# Always write to the RichLog widget
86-
super().write(content, width=width, expand=expand, shrink=shrink, scroll_end=scroll_end)
87-
88-
# Write to stdout if non-interactive mode
89-
if self._non_interactive:
90-
self._write_to_stdout(content)
91-
92-
return self
9350

9451
async def wait_continue(self) -> None:
9552
"""

0 commit comments

Comments
 (0)