Skip to content

Commit 52aca7f

Browse files
committed
Merge branch 'main' into screenshot-location
2 parents 0361d03 + 0067c3c commit 52aca7f

7 files changed

Lines changed: 235 additions & 249 deletions

File tree

poetry.lock

Lines changed: 212 additions & 229 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
[tool.poetry]
22
name = "textual-dev"
3-
version = "1.2.1"
3+
version = "1.4.0"
44
homepage = "https://github.com/Textualize/textual-dev"
55
description = "Development tools for working with Textual"
6-
authors = ["Will McGugan <will@textualize.io>", "Dave Pearson <dave@textualize.io>"]
6+
authors = [
7+
"Will McGugan <will@textualize.io>",
8+
"Dave Pearson <dave@textualize.io>",
9+
]
710
license = "MIT"
811
readme = "README.md"
912
classifiers = [
@@ -20,10 +23,7 @@ classifiers = [
2023
"Programming Language :: Python :: 3.11",
2124
"Typing :: Typed",
2225
]
23-
include = [
24-
"src/textual_dev/py.typed",
25-
{ path = "tests", format = "sdist" },
26-
]
26+
include = ["src/textual_dev/py.typed", { path = "tests", format = "sdist" }]
2727

2828
[tool.poetry.dependencies]
2929
python = "^3.8"

src/textual_dev/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import shlex
66

77
import click
8-
from importlib_metadata import version
8+
from importlib.metadata import version
99
from textual.constants import DEVTOOLS_HOST, DEVTOOLS_PORT
1010

1111
from .tools.run import exec_command, run_app
@@ -71,7 +71,7 @@ def _pre_run_warnings() -> None:
7171
and os.environ.get("TERM_PROGRAM") == "Apple_Terminal"
7272
),
7373
"The default terminal app on macOS is limited to 256 colors. See our FAQ for more details:\n\n"
74-
"https://github.com/Textualize/textual/blob/main/FAQ.md#why-doesn't-textual-look-good-on-macos",
74+
"https://textual.textualize.io/FAQ/#why-doesnt-textual-look-good-on-macos",
7575
)
7676
]
7777

src/textual_dev/previews/colors.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
from textual.color import Color
44
from textual.containers import Horizontal, Vertical, VerticalScroll
55
from textual.design import ColorSystem
6+
from textual.widget import Widget
67
from textual.widgets import Button, Footer, Label, Static, TabbedContent
78

9+
try:
10+
from textual.lazy import Lazy
11+
except ImportError:
12+
13+
def Lazy(widget: Widget) -> Widget: # type: ignore
14+
return widget
15+
816

917
class ThemeColorButtons(VerticalScroll):
1018
def compose(self) -> ComposeResult:
@@ -79,15 +87,8 @@ class ColorsApp(App[None]):
7987
def compose(self) -> ComposeResult:
8088
yield Footer()
8189
with ColorTabs("Theme Colors", "Named Colors"):
82-
yield Content(ThemeColorButtons(), id="theme")
83-
yield NamedColorsView()
84-
85-
def on_mount(self) -> None:
86-
self.call_after_refresh(self.update_view)
87-
88-
async def update_view(self) -> None:
89-
content = self.query_one("#theme", Content)
90-
await content.mount(ThemeColorsView())
90+
yield Content(ThemeColorButtons(), ThemeColorsView(), id="theme")
91+
yield Lazy(NamedColorsView())
9192

9293
def on_button_pressed(self, event: Button.Pressed) -> None:
9394
self.query(ColorGroup).remove_class("-active")

src/textual_dev/renderables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import Path
55
from typing import Iterable
66

7-
from importlib_metadata import version
7+
from importlib.metadata import version
88
from rich.align import Align
99
from rich.console import Console, ConsoleOptions, RenderResult
1010
from rich.markup import escape

src/textual_dev/tools/diagnose.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from functools import singledispatch
99
from typing import Any
1010

11-
from importlib_metadata import version
11+
from importlib.metadata import version
1212
from rich.console import Console, ConsoleDimensions
1313

1414

@@ -88,6 +88,8 @@ def _guess_term() -> str:
8888
term_program = "GNOME Terminal"
8989
elif "XTERM_VERSION" in os.environ:
9090
term_program = os.environ.get("XTERM_VERSION") or "XTerm"
91+
elif "TERMINATOR_UUID" in os.environ:
92+
term_program = "Terminator"
9193

9294
else:
9395
# See if we can pull out some sort of version information too.

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from click.testing import CliRunner
2-
from importlib_metadata import version
2+
from importlib.metadata import version
33

44
from textual_dev.cli import run
55

0 commit comments

Comments
 (0)