diff --git a/src/textual/_context.py b/src/textual/_context.py index d28a1b15a2..039bb7b4ef 100644 --- a/src/textual/_context.py +++ b/src/textual/_context.py @@ -1,7 +1,7 @@ from __future__ import annotations from contextvars import ContextVar -from typing import TYPE_CHECKING, Any, Callable, TypeVar +from typing import TYPE_CHECKING, Any, Callable if TYPE_CHECKING: from .app import App @@ -14,10 +14,6 @@ class NoActiveAppError(RuntimeError): """Runtime error raised if we try to retrieve the active app when there is none.""" -ContextVarType = TypeVar("ContextVarType") -DefaultType = TypeVar("DefaultType") - - active_app: ContextVar["App[Any]"] = ContextVar("active_app") active_message_pump: ContextVar["MessagePump"] = ContextVar("active_message_pump") diff --git a/src/textual/app.py b/src/textual/app.py index ba0e79bb9f..e01f6842cf 100644 --- a/src/textual/app.py +++ b/src/textual/app.py @@ -2687,6 +2687,7 @@ def _build_driver( return driver async def _init_devtools(self): + """Initialize developer tools.""" if self.devtools is not None: from textual_dev.client import DevtoolsConnectionError @@ -2707,6 +2708,11 @@ async def _process_messages( message_hook: Callable[[Message], None] | None = None, ) -> None: async def app_prelude() -> bool: + """Work required before running the app. + + Returns: + `True` if the app should continue, or `False` if there was a problem starting. + """ await self._init_devtools() self.log.system("---") self.log.system(loop=asyncio.get_running_loop()) diff --git a/src/textual/css/styles.py b/src/textual/css/styles.py index 27dc9f6892..8fe230bc75 100644 --- a/src/textual/css/styles.py +++ b/src/textual/css/styles.py @@ -554,7 +554,6 @@ def is_animatable(cls, rule: str) -> bool: return rule in cls.ANIMATABLE @classmethod - # @lru_cache(maxsize=1024) def parse( cls, css: str, read_from: CSSLocation, *, node: DOMNode | None = None ) -> Styles: