The following issues were found
src/textual/_ansi_sequences.py
3 issues
Line: 3
Column: 1
from typing import Dict, Tuple, Union
from .keys import Keys
# Mapping of vt100 escape codes to Keys.
ANSI_SEQUENCES: Dict[str, Tuple[Keys, ...]] = {
# Control keys.
"\x00": (Keys.ControlAt,), # Control-At (Also for Ctrl-Space)
"\x01": (Keys.ControlA,), # Control-A (home)
Reported by Pylint.
Line: 1
Column: 1
from typing import Dict, Tuple, Union
from .keys import Keys
# Mapping of vt100 escape codes to Keys.
ANSI_SEQUENCES: Dict[str, Tuple[Keys, ...]] = {
# Control keys.
"\x00": (Keys.ControlAt,), # Control-At (Also for Ctrl-Space)
"\x01": (Keys.ControlA,), # Control-A (home)
Reported by Pylint.
Line: 1
Column: 1
from typing import Dict, Tuple, Union
from .keys import Keys
# Mapping of vt100 escape codes to Keys.
ANSI_SEQUENCES: Dict[str, Tuple[Keys, ...]] = {
# Control keys.
"\x00": (Keys.ControlAt,), # Control-At (Also for Ctrl-Space)
"\x01": (Keys.ControlA,), # Control-A (home)
Reported by Pylint.
src/textual/_layout_resolve.py
3 issues
Line: 10
Column: 5
if sys.version_info >= (3, 8):
from typing import Protocol
else:
from typing_extensions import Protocol # pragma: no cover
class Edge(Protocol):
"""Any object that defines an edge (such as Layout)."""
Reported by Pylint.
Line: 1
Column: 1
from __future__ import annotations
import sys
from fractions import Fraction
from typing import cast, List, Optional, Sequence
if sys.version_info >= (3, 8):
from typing import Protocol
else:
Reported by Pylint.
Line: 13
Column: 1
from typing_extensions import Protocol # pragma: no cover
class Edge(Protocol):
"""Any object that defines an edge (such as Layout)."""
size: Optional[int] = None
fraction: int = 1
min_size: int = 1
Reported by Pylint.
src/textual/_loop.py
2 issues
Line: 1
Column: 1
from typing import Iterable, Tuple, TypeVar
T = TypeVar("T")
def loop_first(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
"""Iterate and generate a tuple with a flag for first value."""
iter_values = iter(values)
try:
Reported by Pylint.
Line: 3
Column: 1
from typing import Iterable, Tuple, TypeVar
T = TypeVar("T")
def loop_first(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
"""Iterate and generate a tuple with a flag for first value."""
iter_values = iter(values)
try:
Reported by Pylint.
src/textual/_context.py
2 issues
Line: 6
Column: 5
from contextvars import ContextVar
if TYPE_CHECKING:
from .app import App
active_app: ContextVar["App"] = ContextVar("active_app")
Reported by Pylint.
Line: 1
Column: 1
from typing import TYPE_CHECKING
from contextvars import ContextVar
if TYPE_CHECKING:
from .app import App
active_app: ContextVar["App"] = ContextVar("active_app")
Reported by Pylint.
src/textual/_callback.py
1 issues
Line: 1
Column: 1
from __future__ import annotations
from functools import lru_cache
from inspect import signature, isawaitable
from typing import Any, Callable
@lru_cache(maxsize=2048)
Reported by Pylint.
src/textual/_profile.py
1 issues
Line: 11
Column: 1
import contextlib
from typing import Generator
from . import log
@contextlib.contextmanager
def timer(subject: str = "time") -> Generator[None, None, None]:
"""print the elapsed time. (only used in debugging)"""
Reported by Pylint.
src/textual/case.py
1 issues
Line: 1
Column: 1
import re
from typing import Match, Pattern
def camel_to_snake(
name: str, _re_snake: Pattern[str] = re.compile("[a-z][A-Z]")
) -> str:
"""Convert name from CamelCase to snake_case.
Reported by Pylint.