mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fix imports.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import asyncio
|
||||
import time
|
||||
from random import randint
|
||||
|
||||
from textual.app import App, ComposeResult
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from textual import on
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Button
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.containers import Horizontal
|
||||
from textual.widgets import Button, Input
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class ValidateApp(App):
|
||||
self.count += 1
|
||||
else:
|
||||
self.count -= 1
|
||||
self.query_one(RichLog).write(f"{self.count=}")
|
||||
self.query_one(RichLog).write(f"count = {self.count}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from textual.app import App
|
||||
from textual.containers import Container, Grid
|
||||
from textual.containers import Grid
|
||||
from textual.widgets import Placeholder
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from rich.align import VerticalCenter
|
||||
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.containers import Horizontal, VerticalScroll
|
||||
from textual.widgets import Button, ContentSwitcher, DataTable, Markdown
|
||||
|
||||
@@ -165,8 +165,6 @@ if __name__ == "__main__":
|
||||
|
||||
test_parser = TestParser()
|
||||
|
||||
import time
|
||||
|
||||
for n in range(0, len(data), 5):
|
||||
for token in test_parser.feed(data[n : n + 5]):
|
||||
print(token)
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
from typing import TYPE_CHECKING, Any, Awaitable, Callable, List, Union
|
||||
|
||||
from typing_extensions import (
|
||||
Literal,
|
||||
Protocol,
|
||||
SupportsIndex,
|
||||
get_args,
|
||||
runtime_checkable,
|
||||
)
|
||||
from typing_extensions import Protocol
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from rich.segment import Segment
|
||||
|
||||
@@ -47,7 +47,7 @@ from .transition import Transition
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .._layout import Layout
|
||||
from .styles import Styles, StylesBase
|
||||
from .styles import StylesBase
|
||||
|
||||
from .types import AlignHorizontal, AlignVertical, DockEdge, EdgeType
|
||||
|
||||
|
||||
@@ -5,12 +5,13 @@ from dataclasses import dataclass
|
||||
from functools import lru_cache
|
||||
from typing import TYPE_CHECKING, NamedTuple, Tuple, overload
|
||||
|
||||
from typing_extensions import Literal, get_args
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from tree_sitter import Node
|
||||
from tree_sitter.binding import Query
|
||||
|
||||
from textual._cells import cell_len
|
||||
from textual._types import Literal, get_args
|
||||
from textual.geometry import Size
|
||||
|
||||
Newline = Literal["\r\n", "\n", "\r"]
|
||||
|
||||
@@ -4,8 +4,6 @@ import sys
|
||||
from threading import Event
|
||||
from typing import Iterator
|
||||
|
||||
from textual import log
|
||||
|
||||
|
||||
class InputReader:
|
||||
"""Read input from stdin."""
|
||||
|
||||
@@ -14,7 +14,7 @@ from typing import TYPE_CHECKING, Any
|
||||
import rich.repr
|
||||
import rich.traceback
|
||||
|
||||
from .. import events, log
|
||||
from .. import events
|
||||
from .._xterm_parser import XTermParser
|
||||
from ..driver import Driver
|
||||
from ..geometry import Size
|
||||
|
||||
@@ -26,7 +26,6 @@ from ._context import message_hook as message_hook_context_var
|
||||
from ._context import prevent_message_types_stack
|
||||
from ._on import OnNoWidget
|
||||
from ._time import time
|
||||
from ._types import CallbackType
|
||||
from .case import camel_to_snake
|
||||
from .css.match import match
|
||||
from .errors import DuplicateKeyHandlers
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from asyncio import create_task
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ from typing import TYPE_CHECKING, Any, Iterable, Optional, Tuple
|
||||
|
||||
from rich.style import Style
|
||||
from rich.text import Text
|
||||
from typing_extensions import Literal, Protocol, runtime_checkable
|
||||
|
||||
from textual._text_area_theme import TextAreaTheme
|
||||
from textual._tree_sitter import TREE_SITTER
|
||||
@@ -30,11 +31,9 @@ from textual.expand_tabs import expand_tabs_inline
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from tree_sitter import Language
|
||||
from tree_sitter.binding import Query
|
||||
|
||||
from textual import events, log
|
||||
from textual._cells import cell_len
|
||||
from textual._types import Literal, Protocol, runtime_checkable
|
||||
from textual.binding import Binding
|
||||
from textual.events import Message, MouseEvent
|
||||
from textual.geometry import Offset, Region, Size, Spacing, clamp
|
||||
|
||||
@@ -2,7 +2,6 @@ import pytest
|
||||
|
||||
from textual.app import App
|
||||
from textual.containers import Grid
|
||||
from textual.screen import Screen
|
||||
from textual.widgets import Label
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from contextlib import nullcontext as does_not_raise
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import pytest
|
||||
|
||||
from textual import on
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.events import Blur
|
||||
from textual.validation import Number, ValidationResult
|
||||
from textual.widgets import Input
|
||||
|
||||
|
||||
@@ -298,8 +298,6 @@ async def test_reactive_inheritance():
|
||||
class Tertiary(Secondary):
|
||||
baz = reactive("baz")
|
||||
|
||||
from rich import print
|
||||
|
||||
primary = Primary()
|
||||
secondary = Secondary()
|
||||
tertiary = Tertiary()
|
||||
|
||||
@@ -6,10 +6,10 @@ import pytest
|
||||
|
||||
from textual import work
|
||||
from textual.app import App, ComposeResult, ScreenStackError
|
||||
from textual.events import MouseMove, MouseScrollDown, MouseScrollUp
|
||||
from textual.events import MouseMove
|
||||
from textual.geometry import Offset
|
||||
from textual.screen import Screen
|
||||
from textual.widgets import Button, DataTable, Input, Label
|
||||
from textual.widgets import Button, Input, Label
|
||||
from textual.worker import NoActiveWorker
|
||||
|
||||
skip_py310 = pytest.mark.skipif(
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from rich.style import Style
|
||||
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import Button, Static
|
||||
|
||||
|
||||
Reference in New Issue
Block a user