mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Exit debug (#2554)
* show single error by default * changelog * show numbers of errors * changelog
This commit is contained in:
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- App `title` and `sub_title` attributes can be set to any type https://github.com/Textualize/textual/issues/2521
|
- App `title` and `sub_title` attributes can be set to any type https://github.com/Textualize/textual/issues/2521
|
||||||
|
- Only a single error will be written by default, unless in dev mode ("debug" in App.features) https://github.com/Textualize/textual/issues/2480
|
||||||
- Using `Widget.move_child` where the target and the child being moved are the same is now a no-op https://github.com/Textualize/textual/issues/1743
|
- Using `Widget.move_child` where the target and the child being moved are the same is now a no-op https://github.com/Textualize/textual/issues/1743
|
||||||
- Calling `dismiss` on a screen that is not at the top of the stack now raises an exception https://github.com/Textualize/textual/issues/2575
|
- Calling `dismiss` on a screen that is not at the top of the stack now raises an exception https://github.com/Textualize/textual/issues/2575
|
||||||
- `MessagePump.call_after_refresh` and `MessagePump.call_later` will not return `False` if the callback could not be scheduled. https://github.com/Textualize/textual/pull/2584
|
- `MessagePump.call_after_refresh` and `MessagePump.call_later` will not return `False` if the callback could not be scheduled. https://github.com/Textualize/textual/pull/2584
|
||||||
|
|||||||
@@ -1630,8 +1630,22 @@ class App(Generic[ReturnType], DOMNode):
|
|||||||
|
|
||||||
def _print_error_renderables(self) -> None:
|
def _print_error_renderables(self) -> None:
|
||||||
"""Print and clear exit renderables."""
|
"""Print and clear exit renderables."""
|
||||||
|
error_count = len(self._exit_renderables)
|
||||||
|
if "debug" in self.features:
|
||||||
for renderable in self._exit_renderables:
|
for renderable in self._exit_renderables:
|
||||||
self.error_console.print(renderable)
|
self.error_console.print(renderable)
|
||||||
|
if error_count > 1:
|
||||||
|
self.error_console.print(
|
||||||
|
f"\n[b]NOTE:[/b] {error_count} errors show above.", markup=True
|
||||||
|
)
|
||||||
|
elif self._exit_renderables:
|
||||||
|
self.error_console.print(self._exit_renderables[0])
|
||||||
|
if error_count > 1:
|
||||||
|
self.error_console.print(
|
||||||
|
f"\n[b]NOTE:[/b] 1 of {error_count} errors show. Run with [b]--dev[/] to see all errors.",
|
||||||
|
markup=True,
|
||||||
|
)
|
||||||
|
|
||||||
self._exit_renderables.clear()
|
self._exit_renderables.clear()
|
||||||
|
|
||||||
async def _process_messages(
|
async def _process_messages(
|
||||||
|
|||||||
Reference in New Issue
Block a user