Skip to content

Commit

Permalink
Module docs
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Sep 19, 2023
1 parent 26ba3b1 commit 27ab81e
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/api/logger.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Logger

A [logger class](/guide/devtools/#logging-handler) that logs to the Textual [console](/guide/devtools#console).

::: textual.Logger
4 changes: 4 additions & 0 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,10 @@ async def run_test(
) -> AsyncGenerator[Pilot, 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:
Expand Down
5 changes: 5 additions & 0 deletions src/textual/errors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
General exception classes.
"""

from __future__ import annotations


Expand Down
13 changes: 13 additions & 0 deletions src/textual/filter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
"""Filter classes.
!!! note
Filters are used internally, and not recommended for use by Textual app developers.
Filters are used internally to process terminal output after it has been rendered.
Currently this is used internally to convert the application to monochrome, when the NO_COLOR env var is set.
In the future, this system will be used to implement accessibility features.
"""

from __future__ import annotations

from abc import ABC, abstractmethod
Expand Down
7 changes: 7 additions & 0 deletions src/textual/fuzzy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Fuzzy matcher.
This class is used by the [command palette](guide/command) to match search terms.
"""

from __future__ import annotations

from re import IGNORECASE, compile, escape
Expand Down
7 changes: 6 additions & 1 deletion src/textual/message_pump.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
"""
A message pump is a base class for any object which processes messages, which includes Widget, Screen, and App.
A `MessagePump` is a base class for any object which processes messages, which includes Widget, Screen, and App.
!!! tip
Most of the method here are useful in general app development.
"""
from __future__ import annotations

Expand Down
8 changes: 7 additions & 1 deletion src/textual/pilot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""
The pilot object is used by [App.run_test][textual.app.App.run_test] to programmatically operate an app.
See the guide on how to [test Textual apps](/guide/testing).
"""

from __future__ import annotations
Expand Down Expand Up @@ -42,7 +45,10 @@ def _get_mouse_message_arguments(


class WaitForScreenTimeout(Exception):
pass
"""Exception raised if messages aren't being processed quickly enough.
If this occurs, the most likely explanation is some kind of deadlock in the app code.
"""


@rich.repr.auto(angular=True)
Expand Down
6 changes: 6 additions & 0 deletions src/textual/suggester.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""
The `Suggester` class is used by the [Input](/widgets/input) widget.
"""

from __future__ import annotations

from abc import ABC, abstractmethod
Expand Down

0 comments on commit 27ab81e

Please sign in to comment.