Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Sep 7, 2024
1 parent 36778f8 commit b6b79c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/textual/_context.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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")

Expand Down
6 changes: 6 additions & 0 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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())
Expand Down
1 change: 0 additions & 1 deletion src/textual/css/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b6b79c7

Please sign in to comment.