Fix imports.

This commit is contained in:
Rodrigo Girão Serrão
2023-10-26 12:15:55 +01:00
parent ec44d17ccc
commit 6f00943c14
21 changed files with 10 additions and 34 deletions

View File

@@ -1,5 +1,4 @@
import asyncio
import time
from random import randint
from textual.app import App, ComposeResult

View File

@@ -1,4 +1,3 @@
from textual import on
from textual.app import App, ComposeResult
from textual.widgets import Button

View File

@@ -1,5 +1,4 @@
from textual.app import App, ComposeResult
from textual.containers import Horizontal
from textual.widgets import Button, Input

View File

@@ -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__":

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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"]

View File

@@ -4,8 +4,6 @@ import sys
from threading import Event
from typing import Iterator
from textual import log
class InputReader:
"""Read input from stdin."""

View File

@@ -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

View File

@@ -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

View File

@@ -1,7 +1,6 @@
from __future__ import annotations
import asyncio
from asyncio import create_task
from dataclasses import dataclass
from typing import ClassVar

View File

@@ -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

View File

@@ -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

View File

@@ -1,5 +1,4 @@
from contextlib import nullcontext as does_not_raise
from typing import Any
import pytest

View File

@@ -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

View File

@@ -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()

View File

@@ -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(

View File

@@ -1,5 +1,3 @@
from rich.style import Style
from textual.app import App, ComposeResult
from textual.widgets import Button, Static