The following issues were found
docs/examples/messages_and_events/color_changer.py
6 issues
Line: 1
Column: 1
from textual.app import App
class ColorChanger(App):
def on_key(self, event):
if event.key.isdigit():
self.background = f"on color({event.key})"
Reported by Pylint.
Line: 7
Column: 13
class ColorChanger(App):
def on_key(self, event):
if event.key.isdigit():
self.background = f"on color({event.key})"
ColorChanger.run(log="textual.log")
Reported by Pylint.
Line: 1
Column: 1
from textual.app import App
class ColorChanger(App):
def on_key(self, event):
if event.key.isdigit():
self.background = f"on color({event.key})"
Reported by Pylint.
Line: 4
Column: 1
from textual.app import App
class ColorChanger(App):
def on_key(self, event):
if event.key.isdigit():
self.background = f"on color({event.key})"
Reported by Pylint.
Line: 4
Column: 1
from textual.app import App
class ColorChanger(App):
def on_key(self, event):
if event.key.isdigit():
self.background = f"on color({event.key})"
Reported by Pylint.
Line: 5
Column: 5
class ColorChanger(App):
def on_key(self, event):
if event.key.isdigit():
self.background = f"on color({event.key})"
ColorChanger.run(log="textual.log")
Reported by Pylint.
docs/examples/actions/colorizer.py
6 issues
Line: 1
Column: 1
from textual.app import App
class Colorizer(App):
async def on_load(self):
await self.bind("r", "color('red')")
await self.bind("g", "color('green')")
await self.bind("b", "color('blue')")
Reported by Pylint.
Line: 11
Column: 9
await self.bind("b", "color('blue')")
async def action_color(self, color: str) -> None:
self.background = f"on {color}"
Colorizer.run()
Reported by Pylint.
Line: 1
Column: 1
from textual.app import App
class Colorizer(App):
async def on_load(self):
await self.bind("r", "color('red')")
await self.bind("g", "color('green')")
await self.bind("b", "color('blue')")
Reported by Pylint.
Line: 4
Column: 1
from textual.app import App
class Colorizer(App):
async def on_load(self):
await self.bind("r", "color('red')")
await self.bind("g", "color('green')")
await self.bind("b", "color('blue')")
Reported by Pylint.
Line: 5
Column: 5
class Colorizer(App):
async def on_load(self):
await self.bind("r", "color('red')")
await self.bind("g", "color('green')")
await self.bind("b", "color('blue')")
async def action_color(self, color: str) -> None:
Reported by Pylint.
Line: 10
Column: 5
await self.bind("g", "color('green')")
await self.bind("b", "color('blue')")
async def action_color(self, color: str) -> None:
self.background = f"on {color}"
Colorizer.run()
Reported by Pylint.
examples/grid.py
5 issues
Line: 1
Column: 1
from textual.app import App
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self) -> None:
"""Make a simple grid arrangement."""
grid = await self.view.dock_grid(edge="left", size=70, name="left")
Reported by Pylint.
Line: 2
Column: 1
from textual.app import App
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self) -> None:
"""Make a simple grid arrangement."""
grid = await self.view.dock_grid(edge="left", size=70, name="left")
Reported by Pylint.
Line: 1
Column: 1
from textual.app import App
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self) -> None:
"""Make a simple grid arrangement."""
grid = await self.view.dock_grid(edge="left", size=70, name="left")
Reported by Pylint.
Line: 5
Column: 1
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self) -> None:
"""Make a simple grid arrangement."""
grid = await self.view.dock_grid(edge="left", size=70, name="left")
Reported by Pylint.
Line: 5
Column: 1
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self) -> None:
"""Make a simple grid arrangement."""
grid = await self.view.dock_grid(edge="left", size=70, name="left")
Reported by Pylint.
src/textual/actions.py
5 issues
Line: 4
Column: 1
from __future__ import annotations
import ast
from typing import Any, Tuple
import re
class ActionError(Exception):
pass
Reported by Pylint.
Line: 22
Column: 13
try:
action_params = ast.literal_eval(action_params_str)
except Exception:
raise ActionError(
f"unable to parse {action_params_str!r} in action {action!r}"
)
else:
action_name = action
action_params = ()
Reported by Pylint.
Line: 1
Column: 1
from __future__ import annotations
import ast
from typing import Any, Tuple
import re
class ActionError(Exception):
pass
Reported by Pylint.
Line: 8
Column: 1
import re
class ActionError(Exception):
pass
re_action_params = re.compile(r"([\w\.]+)(\(.*?\))")
Reported by Pylint.
Line: 15
Column: 1
re_action_params = re.compile(r"([\w\.]+)(\(.*?\))")
def parse(action: str) -> tuple[str, tuple[Any, ...]]:
params_match = re_action_params.match(action)
if params_match is not None:
action_name, action_params_str = params_match.groups()
try:
action_params = ast.literal_eval(action_params_str)
Reported by Pylint.
src/textual/_lines.py
5 issues
Line: 3
Column: 1
from __future__ import annotations
from rich.segment import Segment
from .geometry import Region
from ._types import Lines
def crop_lines(lines: Lines, clip: Region) -> Lines:
Reported by Pylint.
Line: 5
Column: 1
from rich.segment import Segment
from .geometry import Region
from ._types import Lines
def crop_lines(lines: Lines, clip: Region) -> Lines:
lines = lines[clip.y : clip.y + clip.height]
Reported by Pylint.
Line: 6
Column: 1
from rich.segment import Segment
from .geometry import Region
from ._types import Lines
def crop_lines(lines: Lines, clip: Region) -> Lines:
lines = lines[clip.y : clip.y + clip.height]
Reported by Pylint.
Line: 1
Column: 1
from __future__ import annotations
from rich.segment import Segment
from .geometry import Region
from ._types import Lines
def crop_lines(lines: Lines, clip: Region) -> Lines:
Reported by Pylint.
Line: 9
Column: 1
from ._types import Lines
def crop_lines(lines: Lines, clip: Region) -> Lines:
lines = lines[clip.y : clip.y + clip.height]
def width_view(line: list[Segment]) -> list[Segment]:
_, line = Segment.divide(line, [clip.x, clip.x + clip.width])
return line
Reported by Pylint.
docs/examples/actions/quiter.py
5 issues
Line: 1
Column: 1
from textual.app import App
class Quiter(App):
async def on_load(self):
await self.bind("q", "quit")
Quiter.run()
Reported by Pylint.
Line: 1
Column: 1
from textual.app import App
class Quiter(App):
async def on_load(self):
await self.bind("q", "quit")
Quiter.run()
Reported by Pylint.
Line: 4
Column: 1
from textual.app import App
class Quiter(App):
async def on_load(self):
await self.bind("q", "quit")
Quiter.run()
Reported by Pylint.
Line: 4
Column: 1
from textual.app import App
class Quiter(App):
async def on_load(self):
await self.bind("q", "quit")
Quiter.run()
Reported by Pylint.
Line: 5
Column: 5
class Quiter(App):
async def on_load(self):
await self.bind("q", "quit")
Quiter.run()
Reported by Pylint.
docs/examples/messages_and_events/beep.py
5 issues
Line: 1
Column: 1
from textual.app import App
class Beeper(App):
def on_key(self):
self.console.bell()
Beeper.run()
Reported by Pylint.
Line: 1
Column: 1
from textual.app import App
class Beeper(App):
def on_key(self):
self.console.bell()
Beeper.run()
Reported by Pylint.
Line: 4
Column: 1
from textual.app import App
class Beeper(App):
def on_key(self):
self.console.bell()
Beeper.run()
Reported by Pylint.
Line: 4
Column: 1
from textual.app import App
class Beeper(App):
def on_key(self):
self.console.bell()
Beeper.run()
Reported by Pylint.
Line: 5
Column: 5
class Beeper(App):
def on_key(self):
self.console.bell()
Beeper.run()
Reported by Pylint.
src/textual/views/__init__.py
4 issues
Line: 1
Column: 1
from ._dock_view import DockView, Dock, DockEdge
from ._grid_view import GridView
from ._window_view import WindowView
Reported by Pylint.
Line: 2
Column: 1
from ._dock_view import DockView, Dock, DockEdge
from ._grid_view import GridView
from ._window_view import WindowView
Reported by Pylint.
Line: 3
Column: 1
from ._dock_view import DockView, Dock, DockEdge
from ._grid_view import GridView
from ._window_view import WindowView
Reported by Pylint.
Line: 1
Column: 1
from ._dock_view import DockView, Dock, DockEdge
from ._grid_view import GridView
from ._window_view import WindowView
Reported by Pylint.
src/textual/_event_broker.py
4 issues
Line: 1
Column: 1
from __future__ import annotations
from typing import Any, NamedTuple
class NoHandler(Exception):
pass
Reported by Pylint.
Line: 6
Column: 1
from typing import Any, NamedTuple
class NoHandler(Exception):
pass
class HandlerArguments(NamedTuple):
modifiers: set[str]
Reported by Pylint.
Line: 10
Column: 1
pass
class HandlerArguments(NamedTuple):
modifiers: set[str]
action: Any
def extract_handler_actions(event_name: str, meta: dict[str, Any]) -> HandlerArguments:
Reported by Pylint.
Line: 15
Column: 1
action: Any
def extract_handler_actions(event_name: str, meta: dict[str, Any]) -> HandlerArguments:
event_path = event_name.split(".")
for key, value in meta.items():
if key.startswith("@"):
name_args = key[1:].split(".")
if name_args[: len(event_path)] == event_path:
Reported by Pylint.
src/textual/views/_document_view.py
3 issues
Line: 3
Column: 1
from __future__ import annotations
from ..view import View
Reported by Pylint.
Line: 3
Column: 1
from __future__ import annotations
from ..view import View
Reported by Pylint.
Line: 1
Column: 1
from __future__ import annotations
from ..view import View
Reported by Pylint.