The following issues were found
src/textual/widgets/__init__.py
9 issues
Line: 1
Column: 1
from ._footer import Footer
from ._header import Header
from ._button import Button, ButtonPressed
from ._placeholder import Placeholder
from ._scroll_view import ScrollView
from ._static import Static
from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
from ._directory_tree import DirectoryTree, FileClick
Reported by Pylint.
Line: 2
Column: 1
from ._footer import Footer
from ._header import Header
from ._button import Button, ButtonPressed
from ._placeholder import Placeholder
from ._scroll_view import ScrollView
from ._static import Static
from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
from ._directory_tree import DirectoryTree, FileClick
Reported by Pylint.
Line: 3
Column: 1
from ._footer import Footer
from ._header import Header
from ._button import Button, ButtonPressed
from ._placeholder import Placeholder
from ._scroll_view import ScrollView
from ._static import Static
from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
from ._directory_tree import DirectoryTree, FileClick
Reported by Pylint.
Line: 4
Column: 1
from ._footer import Footer
from ._header import Header
from ._button import Button, ButtonPressed
from ._placeholder import Placeholder
from ._scroll_view import ScrollView
from ._static import Static
from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
from ._directory_tree import DirectoryTree, FileClick
Reported by Pylint.
Line: 5
Column: 1
from ._header import Header
from ._button import Button, ButtonPressed
from ._placeholder import Placeholder
from ._scroll_view import ScrollView
from ._static import Static
from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
from ._directory_tree import DirectoryTree, FileClick
__all__ = [
Reported by Pylint.
Line: 6
Column: 1
from ._button import Button, ButtonPressed
from ._placeholder import Placeholder
from ._scroll_view import ScrollView
from ._static import Static
from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
from ._directory_tree import DirectoryTree, FileClick
__all__ = [
"Button",
Reported by Pylint.
Line: 7
Column: 1
from ._placeholder import Placeholder
from ._scroll_view import ScrollView
from ._static import Static
from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
from ._directory_tree import DirectoryTree, FileClick
__all__ = [
"Button",
"ButtonPressed",
Reported by Pylint.
Line: 8
Column: 1
from ._scroll_view import ScrollView
from ._static import Static
from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
from ._directory_tree import DirectoryTree, FileClick
__all__ = [
"Button",
"ButtonPressed",
"DirectoryTree",
Reported by Pylint.
Line: 1
Column: 1
from ._footer import Footer
from ._header import Header
from ._button import Button, ButtonPressed
from ._placeholder import Placeholder
from ._scroll_view import ScrollView
from ._static import Static
from ._tree_control import TreeControl, TreeClick, TreeNode, NodeID
from ._directory_tree import DirectoryTree, FileClick
Reported by Pylint.
src/textual/widgets/_static.py
9 issues
Line: 3
Column: 1
from __future__ import annotations
from rich.console import RenderableType
from rich.padding import Padding, PaddingDimensions
from rich.style import StyleType
from rich.styled import Styled
from ..widget import Widget
Reported by Pylint.
Line: 4
Column: 1
from __future__ import annotations
from rich.console import RenderableType
from rich.padding import Padding, PaddingDimensions
from rich.style import StyleType
from rich.styled import Styled
from ..widget import Widget
Reported by Pylint.
Line: 5
Column: 1
from rich.console import RenderableType
from rich.padding import Padding, PaddingDimensions
from rich.style import StyleType
from rich.styled import Styled
from ..widget import Widget
class Static(Widget):
Reported by Pylint.
Line: 6
Column: 1
from rich.console import RenderableType
from rich.padding import Padding, PaddingDimensions
from rich.style import StyleType
from rich.styled import Styled
from ..widget import Widget
class Static(Widget):
def __init__(
Reported by Pylint.
Line: 7
Column: 1
from rich.padding import Padding, PaddingDimensions
from rich.style import StyleType
from rich.styled import Styled
from ..widget import Widget
class Static(Widget):
def __init__(
self,
Reported by Pylint.
Line: 1
Column: 1
from __future__ import annotations
from rich.console import RenderableType
from rich.padding import Padding, PaddingDimensions
from rich.style import StyleType
from rich.styled import Styled
from ..widget import Widget
Reported by Pylint.
Line: 10
Column: 1
from ..widget import Widget
class Static(Widget):
def __init__(
self,
renderable: RenderableType,
name: str | None = None,
style: StyleType = "",
Reported by Pylint.
Line: 23
Column: 5
self.style = style
self.padding = padding
def render(self) -> RenderableType:
renderable = self.renderable
if self.padding:
renderable = Padding(renderable, self.padding)
return Styled(renderable, self.style)
Reported by Pylint.
Line: 29
Column: 5
renderable = Padding(renderable, self.padding)
return Styled(renderable, self.style)
async def update(self, renderable: RenderableType) -> None:
self.renderable = renderable
self.refresh()
Reported by Pylint.
examples/animation.py
8 issues
Line: 1
Column: 1
from textual import events
from textual.app import App
from textual.reactive import Reactive
from textual.widgets import Footer, Placeholder
class SmoothApp(App):
"""Demonstrates smooth animation. Press 'b' to see it in action."""
Reported by Pylint.
Line: 2
Column: 1
from textual import events
from textual.app import App
from textual.reactive import Reactive
from textual.widgets import Footer, Placeholder
class SmoothApp(App):
"""Demonstrates smooth animation. Press 'b' to see it in action."""
Reported by Pylint.
Line: 3
Column: 1
from textual import events
from textual.app import App
from textual.reactive import Reactive
from textual.widgets import Footer, Placeholder
class SmoothApp(App):
"""Demonstrates smooth animation. Press 'b' to see it in action."""
Reported by Pylint.
Line: 4
Column: 1
from textual import events
from textual.app import App
from textual.reactive import Reactive
from textual.widgets import Footer, Placeholder
class SmoothApp(App):
"""Demonstrates smooth animation. Press 'b' to see it in action."""
Reported by Pylint.
Line: 25
Column: 30
"""Called when user hits 'b' key."""
self.show_bar = not self.show_bar
async def on_mount(self, event: events.Mount) -> None:
"""Build layout here."""
footer = Footer()
self.bar = Placeholder(name="left")
await self.view.dock(footer, edge="bottom")
Reported by Pylint.
Line: 28
Column: 9
async def on_mount(self, event: events.Mount) -> None:
"""Build layout here."""
footer = Footer()
self.bar = Placeholder(name="left")
await self.view.dock(footer, edge="bottom")
await self.view.dock(Placeholder(), Placeholder(), edge="top")
await self.view.dock(self.bar, edge="left", size=40, z=1)
Reported by Pylint.
Line: 1
Column: 1
from textual import events
from textual.app import App
from textual.reactive import Reactive
from textual.widgets import Footer, Placeholder
class SmoothApp(App):
"""Demonstrates smooth animation. Press 'b' to see it in action."""
Reported by Pylint.
Line: 28
Column: 9
async def on_mount(self, event: events.Mount) -> None:
"""Build layout here."""
footer = Footer()
self.bar = Placeholder(name="left")
await self.view.dock(footer, edge="bottom")
await self.view.dock(Placeholder(), Placeholder(), edge="top")
await self.view.dock(self.bar, edge="left", size=40, z=1)
Reported by Pylint.
examples/simple.py
8 issues
Line: 1
Column: 1
from rich.markdown import Markdown
from textual import events
from textual.app import App
from textual.widgets import Header, Footer, Placeholder, ScrollView
class MyApp(App):
"""An example of a very simple Textual App"""
Reported by Pylint.
Line: 3
Column: 1
from rich.markdown import Markdown
from textual import events
from textual.app import App
from textual.widgets import Header, Footer, Placeholder, ScrollView
class MyApp(App):
"""An example of a very simple Textual App"""
Reported by Pylint.
Line: 4
Column: 1
from rich.markdown import Markdown
from textual import events
from textual.app import App
from textual.widgets import Header, Footer, Placeholder, ScrollView
class MyApp(App):
"""An example of a very simple Textual App"""
Reported by Pylint.
Line: 5
Column: 1
from textual import events
from textual.app import App
from textual.widgets import Header, Footer, Placeholder, ScrollView
class MyApp(App):
"""An example of a very simple Textual App"""
Reported by Pylint.
Line: 11
Column: 29
class MyApp(App):
"""An example of a very simple Textual App"""
async def on_load(self, event: events.Load) -> None:
"""Bind keys with the app loads (but before entering application mode)"""
await self.bind("b", "view.toggle('sidebar')", "Toggle sidebar")
await self.bind("q", "quit", "Quit")
async def on_mount(self, event: events.Mount) -> None:
Reported by Pylint.
Line: 16
Column: 30
await self.bind("b", "view.toggle('sidebar')", "Toggle sidebar")
await self.bind("q", "quit", "Quit")
async def on_mount(self, event: events.Mount) -> None:
"""Create and dock the widgets."""
# A scrollview to contain the markdown file
body = ScrollView()
Reported by Pylint.
Line: 1
Column: 1
from rich.markdown import Markdown
from textual import events
from textual.app import App
from textual.widgets import Header, Footer, Placeholder, ScrollView
class MyApp(App):
"""An example of a very simple Textual App"""
Reported by Pylint.
Line: 31
Column: 42
await self.view.dock(body, edge="right")
async def get_markdown(filename: str) -> None:
with open(filename, "rt") as fh:
readme = Markdown(fh.read(), hyperlinks=True)
await body.update(readme)
await self.call_later(get_markdown, "richreadme.md")
Reported by Pylint.
src/textual/views/_grid_view.py
7 issues
Line: 1
Column: 1
from ..view import View
from ..layouts.grid import GridLayout
class GridView(View, layout=GridLayout):
@property
def grid(self) -> GridLayout:
assert isinstance(self.layout, GridLayout)
return self.layout
Reported by Pylint.
Line: 2
Column: 1
from ..view import View
from ..layouts.grid import GridLayout
class GridView(View, layout=GridLayout):
@property
def grid(self) -> GridLayout:
assert isinstance(self.layout, GridLayout)
return self.layout
Reported by Pylint.
Line: 1
Column: 1
from ..view import View
from ..layouts.grid import GridLayout
class GridView(View, layout=GridLayout):
@property
def grid(self) -> GridLayout:
assert isinstance(self.layout, GridLayout)
return self.layout
Reported by Pylint.
Line: 5
Column: 1
from ..layouts.grid import GridLayout
class GridView(View, layout=GridLayout):
@property
def grid(self) -> GridLayout:
assert isinstance(self.layout, GridLayout)
return self.layout
Reported by Pylint.
Line: 5
Column: 1
from ..layouts.grid import GridLayout
class GridView(View, layout=GridLayout):
@property
def grid(self) -> GridLayout:
assert isinstance(self.layout, GridLayout)
return self.layout
Reported by Pylint.
Line: 7
Column: 5
class GridView(View, layout=GridLayout):
@property
def grid(self) -> GridLayout:
assert isinstance(self.layout, GridLayout)
return self.layout
Reported by Pylint.
Line: 8
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
class GridView(View, layout=GridLayout):
@property
def grid(self) -> GridLayout:
assert isinstance(self.layout, GridLayout)
return self.layout
Reported by Bandit.
src/textual/__init__.py
7 issues
Line: 7
Column: 5
def log(*args: Any, verbosity: int = 0) -> None:
from ._context import active_app
app = active_app.get()
app.log(*args, verbosity=verbosity)
Reported by Pylint.
Line: 14
Column: 5
def panic(*args: Any) -> None:
from ._context import active_app
app = active_app.get()
app.panic(*args)
Reported by Pylint.
Line: 1
Column: 1
from typing import Any
__all__ = ["log", "panic"]
def log(*args: Any, verbosity: int = 0) -> None:
from ._context import active_app
app = active_app.get()
Reported by Pylint.
Line: 6
Column: 1
__all__ = ["log", "panic"]
def log(*args: Any, verbosity: int = 0) -> None:
from ._context import active_app
app = active_app.get()
app.log(*args, verbosity=verbosity)
Reported by Pylint.
Line: 7
Column: 5
def log(*args: Any, verbosity: int = 0) -> None:
from ._context import active_app
app = active_app.get()
app.log(*args, verbosity=verbosity)
Reported by Pylint.
Line: 13
Column: 1
app.log(*args, verbosity=verbosity)
def panic(*args: Any) -> None:
from ._context import active_app
app = active_app.get()
app.panic(*args)
Reported by Pylint.
Line: 14
Column: 5
def panic(*args: Any) -> None:
from ._context import active_app
app = active_app.get()
app.panic(*args)
Reported by Pylint.
examples/grid_auto.py
7 issues
Line: 1
Column: 1
from textual.app import App
from textual import events
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self, event: events.Mount) -> None:
"""Create a grid with auto-arranging cells."""
Reported by Pylint.
Line: 2
Column: 1
from textual.app import App
from textual import events
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self, event: events.Mount) -> None:
"""Create a grid with auto-arranging cells."""
Reported by Pylint.
Line: 3
Column: 1
from textual.app import App
from textual import events
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self, event: events.Mount) -> None:
"""Create a grid with auto-arranging cells."""
Reported by Pylint.
Line: 7
Column: 30
class GridTest(App):
async def on_mount(self, event: events.Mount) -> None:
"""Create a grid with auto-arranging cells."""
grid = await self.view.dock_grid()
grid.add_column("col", fraction=1, max_size=20)
Reported by Pylint.
Line: 1
Column: 1
from textual.app import App
from textual import events
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self, event: events.Mount) -> None:
"""Create a grid with auto-arranging cells."""
Reported by Pylint.
Line: 6
Column: 1
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self, event: events.Mount) -> None:
"""Create a grid with auto-arranging cells."""
grid = await self.view.dock_grid()
Reported by Pylint.
Line: 6
Column: 1
from textual.widgets import Placeholder
class GridTest(App):
async def on_mount(self, event: events.Mount) -> None:
"""Create a grid with auto-arranging cells."""
grid = await self.view.dock_grid()
Reported by Pylint.
src/textual/message.py
7 issues
Line: 7
Column: 1
from time import monotonic
from typing import ClassVar
import rich.repr
from .case import camel_to_snake
from ._types import MessageTarget
Reported by Pylint.
Line: 9
Column: 1
import rich.repr
from .case import camel_to_snake
from ._types import MessageTarget
@rich.repr.auto
class Message:
Reported by Pylint.
Line: 10
Column: 1
import rich.repr
from .case import camel_to_snake
from ._types import MessageTarget
@rich.repr.auto
class Message:
"""Base class for a message."""
Reported by Pylint.
Line: 69
Column: 27
"""Mark this event as being forwarded."""
self._forwarded = True
def can_replace(self, message: "Message") -> bool:
"""Check if another message may supersede this one.
Args:
message (Message): Another message.
Reported by Pylint.
Line: 1
Column: 1
from __future__ import annotations
from asyncio import Event
from time import monotonic
from typing import ClassVar
import rich.repr
from .case import camel_to_snake
Reported by Pylint.
Line: 62
Column: 5
return self.__done_event
@property
def is_forwarded(self) -> bool:
return self._forwarded
def set_forwarded(self) -> None:
"""Mark this event as being forwarded."""
self._forwarded = True
Reported by Pylint.
Line: 69
Column: 5
"""Mark this event as being forwarded."""
self._forwarded = True
def can_replace(self, message: "Message") -> bool:
"""Check if another message may supersede this one.
Args:
message (Message): Another message.
Reported by Pylint.
docs/examples/messages_and_events/beep_typed.py
7 issues
Line: 1
Column: 1
from textual.app import App
from textual import events
class Beeper(App):
async def on_key(self, event: events.Key) -> None:
self.console.bell()
Reported by Pylint.
Line: 2
Column: 1
from textual.app import App
from textual import events
class Beeper(App):
async def on_key(self, event: events.Key) -> None:
self.console.bell()
Reported by Pylint.
Line: 6
Column: 28
class Beeper(App):
async def on_key(self, event: events.Key) -> None:
self.console.bell()
Beeper.run()
Reported by Pylint.
Line: 1
Column: 1
from textual.app import App
from textual import events
class Beeper(App):
async def on_key(self, event: events.Key) -> None:
self.console.bell()
Reported by Pylint.
Line: 5
Column: 1
from textual import events
class Beeper(App):
async def on_key(self, event: events.Key) -> None:
self.console.bell()
Beeper.run()
Reported by Pylint.
Line: 5
Column: 1
from textual import events
class Beeper(App):
async def on_key(self, event: events.Key) -> None:
self.console.bell()
Beeper.run()
Reported by Pylint.
Line: 6
Column: 5
class Beeper(App):
async def on_key(self, event: events.Key) -> None:
self.console.bell()
Beeper.run()
Reported by Pylint.
docs/examples/widgets/placeholders.py
6 issues
Line: 1
Column: 1
from textual import events
from textual.app import App
from textual.widgets import Placeholder
class SimpleApp(App):
"""Demonstrates smooth animation"""
async def on_mount(self, event: events.Mount) -> None:
Reported by Pylint.
Line: 2
Column: 1
from textual import events
from textual.app import App
from textual.widgets import Placeholder
class SimpleApp(App):
"""Demonstrates smooth animation"""
async def on_mount(self, event: events.Mount) -> None:
Reported by Pylint.
Line: 3
Column: 1
from textual import events
from textual.app import App
from textual.widgets import Placeholder
class SimpleApp(App):
"""Demonstrates smooth animation"""
async def on_mount(self, event: events.Mount) -> None:
Reported by Pylint.
Line: 9
Column: 30
class SimpleApp(App):
"""Demonstrates smooth animation"""
async def on_mount(self, event: events.Mount) -> None:
"""Build layout here."""
await self.view.dock(Placeholder(), edge="left", size=40)
await self.view.dock(Placeholder(), Placeholder(), edge="top")
Reported by Pylint.
Line: 1
Column: 1
from textual import events
from textual.app import App
from textual.widgets import Placeholder
class SimpleApp(App):
"""Demonstrates smooth animation"""
async def on_mount(self, event: events.Mount) -> None:
Reported by Pylint.
Line: 6
Column: 1
from textual.widgets import Placeholder
class SimpleApp(App):
"""Demonstrates smooth animation"""
async def on_mount(self, event: events.Mount) -> None:
"""Build layout here."""
Reported by Pylint.