Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove markup, simplify repr #2623

Merged
merged 4 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- `Placeholder` now sets its color cycle per app https://github.com/Textualize/textual/issues/2590
- Footer now clears key highlight regardless of whether it's in the active screen or not https://github.com/Textualize/textual/issues/2606
- The default Widget repr no longer displays classes and pseudo-classes (to reduce noise in logs). Add them to your `__rich_repr__` method if needed. https://github.com/Textualize/textual/pull/2623

### Removed

Expand Down
6 changes: 3 additions & 3 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
from ._worker_manager import WorkerManager
from .actions import ActionParseResult, SkipAction
from .await_remove import AwaitRemove
from .binding import Binding, _Bindings, BindingType
from .binding import Binding, BindingType, _Bindings
from .css.query import NoMatches
from .css.stylesheet import Stylesheet
from .design import ColorSystem
Expand Down Expand Up @@ -1853,7 +1853,7 @@ async def _process_messages(

if self.css_monitor:
self.set_interval(0.25, self.css_monitor, name="css monitor")
self.log.system("[b green]STARTED[/]", self.css_monitor)
self.log.system("STARTED", self.css_monitor)

async def run_process_messages():
"""The main message loop, invoke below."""
Expand Down Expand Up @@ -2713,7 +2713,7 @@ def action_focus_previous(self) -> None:
def _on_terminal_supports_synchronized_output(
self, message: messages.TerminalSupportsSynchronizedOutput
) -> None:
log.system("[b green]SynchronizedOutput mode is supported")
log.system("SynchronizedOutput mode is supported")
self._sync_available = True

def _begin_update(self) -> None:
Expand Down
3 changes: 0 additions & 3 deletions src/textual/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
class Event(Message):
"""The base class for all events."""

def __rich_repr__(self) -> rich.repr.Result:
yield from ()


@rich.repr.auto
class Callback(Event, bubble=False, verbose=True):
Expand Down
5 changes: 0 additions & 5 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2532,11 +2532,6 @@ def __rich_repr__(self) -> rich.repr.Result:
yield "id", self.id, None
if self.name:
yield "name", self.name
if self.classes:
yield "classes", set(self.classes)
pseudo_classes = self.pseudo_classes
if pseudo_classes:
yield "pseudo_classes", set(pseudo_classes)

def _get_scrollable_region(self, region: Region) -> Region:
"""Adjusts the Widget region to accommodate scrollbars.
Expand Down