* log

* tests

* snapshot tests

* change to richlog

* keep raw lines

* disable highlighting by default

* simplify

* superfluous test

* optimization

* update cell length

* add refresh

* write method

* version bump

* doc fix link

* makes lines private

* docstring

* relax dev dependancy

* remove superfluous code [skip ci]

* added FAQ [skipci]

* fix code in faq [skipci]

* fix typo

* max lines fix
This commit is contained in:
Will McGugan
2023-08-03 10:11:17 +01:00
committed by GitHub
parent b045306c69
commit 879c985296
48 changed files with 3302 additions and 2287 deletions

View File

@@ -0,0 +1,16 @@
---
title: "No widget called TextLog"
alt_titles:
- "ImportError with TextLog"
- "TextLog does not exist"
---
The `TextLog` widget was renamed to `RichLog` in Textual 0.32.0.
You will need to replace all references to `TextLog` in your code, with `RichLog`.
Most IDEs will have a search and replace function which will help you do this.
Here's how you should import RichLog:
```python
from textual.widgets import RichLog
```

View File

@@ -30,7 +30,7 @@ Then the app can be run, passing in various arguments; for example:
# Running with default arguments.
Greetings().run()
# Running with a keyword arguyment.
# Running with a keyword argument.
Greetings(to_greet="davep").run()
# Running with both positional arguments.

View File

@@ -0,0 +1,26 @@
---
title: "How do I fix WorkerDeclarationError?"
alt_titles:
- "Thread=True on Worker"
- "Problem with threaded workers"
---
Textual version 0.31.0 requires that you set `thread=True` on the `@work` decorator if you want to run a threaded worker.
If you want a threaded worker, you would declare it in the following way:
```python
@work(thread=True)
def run_in_background():
...
```
If you *don't* want a threaded worker, you should make your work function `async`:
```python
@work()
async def run_in_background():
...
```
This change was made because it was too easy to accidentally create a threaded worker, which may produce unexpected results.