Skip to content

fix tui error - #9

Open
vipyne wants to merge 1 commit into
elder-plinius:mainfrom
vipyne:vp-tui-uv-fix
Open

fix tui error#9
vipyne wants to merge 1 commit into
elder-plinius:mainfrom
vipyne:vp-tui-uv-fix

Conversation

@vipyne

@vipyne vipyne commented May 6, 2026

Copy link
Copy Markdown

issue: missing textual dependency in pyproject.toml
also this error when running stegg-tui:

warning: The package `typer==0.25.1` does not have an extra named `all`
warning: The package `typer==0.23.2` does not have an extra named `all`
      Built stegg @ file://~/ST3GG
Uninstalled 1 package in 0.87ms
Installed 1 package in 1ms
╭───────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────╮
│ ~/ST3GG/tui.py:321 in compose                                                                   │
│                                                                                                                                      │
│   318 │   │   │   ),                                                                                                                 │
│   319 │   │   │   Vertical(                                                                                                          │
│   320 │   │   │   │   TabbedContent(                                                                                                 │
│ ❱ 321 │   │   │   │   │   TabPane("Home", self._home_content(), id="tab-home"),                                                      │
│   322 │   │   │   │   │   TabPane("Encode", self._encode_content(), id="tab-encode"),                                                │
│   323 │   │   │   │   │   TabPane("Decode", self._decode_content(), id="tab-decode"),                                                │
│   324 │   │   │   │   │   TabPane("Analyze", self._analyze_content(), id="tab-analyze"),                                             │
│                                                                                                                                      │
│ ╭──────────────────────────────────────────────────── locals ────────────────────────────────────────────────────╮                   │
│ │ self = StegosaurusApp(title='🦕 STEGOSAURUS WRECKS', classes={'-dark-mode'}, pseudo_classes={'dark', 'focus'}) │                   │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                   │
│                                                                                                                                      │
│ ~/ST3GG/.venv/lib/python3.12/site-packages/textual/widgets/_tabbed_content.py:225 in __init__   │
│                                                                                                                                      │
│   222 │   │   │   disabled: Whether the TabPane is disabled or not.                                                                  │
│   223 │   │   """                                                                                                                    │
│   224 │   │   self._title = self.render_str(title)                                                                                   │
│ ❱ 225 │   │   super().__init__(                                                                                                      │
│   226 │   │   │   *children, name=name, id=id, classes=classes, disabled=disabled                                                    │
│   227 │   │   )                                                                                                                      │
│   228                                                                                                                                │
│                                                                                                                                      │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮                                                     │
│ │ children = (<generator object StegosaurusApp._home_content at 0x107271e50>,) │                                                     │
│ │  classes = None                                                              │                                                     │
│ │ disabled = False                                                             │                                                     │
│ │       id = 'tab-home'                                                        │                                                     │
│ │     name = None                                                              │                                                     │
│ │     self = TabPane(id='tab-home')                                            │                                                     │
│ │    title = 'Home'                                                            │                                                     │
│ ╰──────────────────────────────────────────────────────────────────────────────╯                                                     │
│                                                                                                                                      │
│ ~/ST3GG/.venv/lib/python3.12/site-packages/textual/widget.py:502 in __init__                    │
│                                                                                                                                      │
│    499 │   │                                                                                                                         │
│    500 │   │   for child in children:                                                                                                │
│    501 │   │   │   if not isinstance(child, Widget):                                                                                 │
│ ❱  502 │   │   │   │   raise TypeError(                                                                                              │
│    503 │   │   │   │   │   f"Widget positional arguments must be Widget subclasses; not {child!                                      │
│    504 │   │   │   │   )                                                                                                             │
│    505 │   │   self._pending_children = list(children)                                                                               │
│                                                                                                                                      │
│ ╭──────────────────────────────────── locals ────────────────────────────────────╮                                                   │
│ │ _null_size = Size(width=0, height=0)                                           │                                                   │
│ │      child = <generator object StegosaurusApp._home_content at 0x107271e50>    │                                                   │
│ │   children = (<generator object StegosaurusApp._home_content at 0x107271e50>,) │                                                   │
│ │    classes = None                                                              │                                                   │
│ │   disabled = False                                                             │                                                   │
│ │         id = 'tab-home'                                                        │                                                   │
│ │     markup = True                                                              │                                                   │
│ │       name = None                                                              │                                                   │
│ │       self = TabPane(id='tab-home')                                            │                                                   │
│ ╰────────────────────────────────────────────────────────────────────────────────╯                                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: Widget positional arguments must be Widget subclasses; not <generator object StegosaurusApp._home_content at 0x107271e50>

The above exception was the direct cause of the following exception:

TypeError: StegosaurusApp(title='🦕 STEGOSAURUS WRECKS', classes={'-dark-mode'}, pseudo_classes={'dark', 'focus'}) compose() method 
returned an invalid result; Widget positional arguments must be Widget subclasses; not <generator object StegosaurusApp._home_content at
0x107271e50>

this PR fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant