Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clock README example crashed when reducing the terminal height #52

Closed
abey79 opened this issue Aug 11, 2021 · 3 comments
Closed

Clock README example crashed when reducing the terminal height #52

abey79 opened this issue Aug 11, 2021 · 3 comments
Labels
bug Something isn't working
Projects

Comments

@abey79
Copy link
Contributor

abey79 commented Aug 11, 2021

While trying the clock example below, I noticed it would systematically crash when I reduce the height of the terminal:

from datetime import datetime

from rich.align import Align

from textual.app import App
from textual.widget import Widget


class Clock(Widget):
    async def on_mount(self, event):
        self.set_interval(1, callback=self.refresh)

    def render(self) -> Align:
        time = datetime.now().strftime("%X")
        return Align.center(time, vertical="middle")

class ClockApp(App):
    async def on_mount(self, event):
        await self.view.dock(Clock())


ClockApp.run()

Environment:
macOS Big Sur
Python 3.9.6
Textual 0.1.9
Terminal: Apple Terminal 2.11 and iTerm2 3.4.8 (the crash happens in both terminal apps)

Error:

(venv) hhip@ab-mpb-two:~/src/baxi $ python -m baxi.baxi
╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────────────────────────────────╮
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/textual/app.py:333 in refresh                                                                                             │
│                                                                                                                                                                                 │
│   330 │   │   │   try:                                                                        ╭────────────────────────── locals ──────────────────────────╮                    │
│   331 │   │   │   │   if sync_available:                                                      │        console = <console width=179 ColorSystem.EIGHT_BIT> │                    │
│   332 │   │   │   │   │   console.file.write("\x1bP=1s\x1b\\")                                │         layout = False                                     │                    │
│ ❱ 333 │   │   │   │   console.print(Screen(Control.home(), self.view, Control.home()))        │        repaint = True                                      │                    │
│   334 │   │   │   │   if sync_available:                                                      │           self = ClockApp(title='Textual Application')     │                    │
│   335 │   │   │   │   │   console.file.write("\x1bP=2s\x1b\\")                                │ sync_available = False                                     │                    │
│   336 │   │   │   │   console.file.flush()                                                    ╰────────────────────────────────────────────────────────────╯                    │
│                                                                                                                                                                                 │
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/rich/console.py:1594 in print                                                                                             │
│                                                                                                                                                                                 │
│   1591 │   │   │   render = self.render                                                                                                                                         │
│   1592 │   │   │   if style is None:                                                                                                                                            │
│   1593 │   │   │   │   for renderable in renderables:                                                                                                                           │
│ ❱ 1594 │   │   │   │   │   extend(render(renderable, render_options))                                                                                                           │
│   1595 │   │   │   else:                                                                                                                                                        │
│   1596 │   │   │   │   for renderable in renderables:                                                                                                                           │
│   1597 │   │   │   │   │   extend(                                                                                                                                              │
│                                                                                                                                                                                 │
│ ╭────────────────────────────────────────── locals ───────────────────────────────────────────╮                                                                                 │
│ │           crop = True                                                                       │                                                                                 │
│ │          emoji = None                                                                       │                                                                                 │
│ │            end = '\n'                                                                       │                                                                                 │
│ │         extend = <built-in method extend of list object at 0x10b06a740>                     │                                                                                 │
│ │         height = None                                                                       │                                                                                 │
│ │      highlight = None                                                                       │                                                                                 │
│ │        justify = None                                                                       │                                                                                 │
│ │         markup = None                                                                       │                                                                                 │
│ │ new_line_start = False                                                                      │                                                                                 │
│ │   new_segments = []                                                                         │                                                                                 │
│ │        no_wrap = None                                                                       │                                                                                 │
│ │        objects = (<rich.screen.Screen object at 0x10b03e0d0>,)                              │                                                                                 │
│ │       overflow = None                                                                       │                                                                                 │
│ │         render = <bound method Console.render of <console width=179 ColorSystem.EIGHT_BIT>> │                                                                                 │
│ │ render_options = ConsoleOptions(                                                            │                                                                                 │
│ │                  │   size=ConsoleDimensions(width=179, height=71),                          │                                                                                 │
│ │                  │   legacy_windows=False,                                                  │                                                                                 │
│ │                  │   min_width=1,                                                           │                                                                                 │
│ │                  │   max_width=179,                                                         │                                                                                 │
│ │                  │   is_terminal=True,                                                      │                                                                                 │
│ │                  │   encoding='utf-8',                                                      │                                                                                 │
│ │                  │   max_height=71,                                                         │                                                                                 │
│ │                  │   justify=None,                                                          │                                                                                 │
│ │                  │   overflow=None,                                                         │                                                                                 │
│ │                  │   no_wrap=None,                                                          │                                                                                 │
│ │                  │   highlight=None,                                                        │                                                                                 │
│ │                  │   markup=None,                                                           │                                                                                 │
│ │                  │   height=None                                                            │                                                                                 │
│ │                  )                                                                          │                                                                                 │
│ │     renderable = <rich.screen.Screen object at 0x10b03e0d0>                                 │                                                                                 │
│ │    renderables = [<rich.screen.Screen object at 0x10b03e0d0>]                               │                                                                                 │
│ │           self = <console width=179 ColorSystem.EIGHT_BIT>                                  │                                                                                 │
│ │            sep = ' '                                                                        │                                                                                 │
│ │      soft_wrap = False                                                                      │                                                                                 │
│ │          style = None                                                                       │                                                                                 │
│ │          width = None                                                                       │                                                                                 │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯                                                                                 │
│                                                                                                                                                                                 │
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/rich/console.py:1226 in render                                                                                            │
│                                                                                                                                                                                 │
│   1223 │   │   │   │   f"object {render_iterable!r} is not renderable"                         ╭────────────────────────────────── locals ───────────────────────────────────╮  │
│   1224 │   │   │   )                                                                           │        _options = ConsoleOptions(                                           │  │
│   1225 │   │   _Segment = Segment                                                              │                   │   size=ConsoleDimensions(width=179, height=71),         │  │
│ ❱ 1226 │   │   for render_output in iter_render:                                               │                   │   legacy_windows=False,                                 │  │
│   1227 │   │   │   if isinstance(render_output, _Segment):                                     │                   │   min_width=1,                                          │  │
│   1228 │   │   │   │   yield render_output                                                     │                   │   max_width=179,                                        │  │
│   1229 │   │   │   else:                                                                       │                   │   is_terminal=True,                                     │  │
│                                                                                                │                   │   encoding='utf-8',                                     │  │
│                                                                                                │                   │   max_height=71,                                        │  │
│                                                                                                │                   │   justify=None,                                         │  │
│                                                                                                │                   │   overflow=None,                                        │  │
│                                                                                                │                   │   no_wrap=None,                                         │  │
│                                                                                                │                   │   highlight=None,                                       │  │
│                                                                                                │                   │   markup=None,                                          │  │
│                                                                                                │                   │   height=None                                           │  │
│                                                                                                │                   )                                                         │  │
│                                                                                                │        _Segment = <class 'rich.segment.Segment'>                            │  │
│                                                                                                │     iter_render = <generator object Screen.__rich_console__ at 0x10aff7e40> │  │
│                                                                                                │         options = ConsoleOptions(                                           │  │
│                                                                                                │                   │   size=ConsoleDimensions(width=179, height=71),         │  │
│                                                                                                │                   │   legacy_windows=False,                                 │  │
│                                                                                                │                   │   min_width=1,                                          │  │
│                                                                                                │                   │   max_width=179,                                        │  │
│                                                                                                │                   │   is_terminal=True,                                     │  │
│                                                                                                │                   │   encoding='utf-8',                                     │  │
│                                                                                                │                   │   max_height=71,                                        │  │
│                                                                                                │                   │   justify=None,                                         │  │
│                                                                                                │                   │   overflow=None,                                        │  │
│                                                                                                │                   │   no_wrap=None,                                         │  │
│                                                                                                │                   │   highlight=None,                                       │  │
│                                                                                                │                   │   markup=None,                                          │  │
│                                                                                                │                   │   height=None                                           │  │
│                                                                                                │                   )                                                         │  │
│                                                                                                │ render_iterable = <generator object Screen.__rich_console__ at 0x10aff7e40> │  │
│                                                                                                │      renderable = <rich.screen.Screen object at 0x10b03e0d0>                │  │
│                                                                                                │            self = <console width=179 ColorSystem.EIGHT_BIT>                 │  │
│                                                                                                ╰─────────────────────────────────────────────────────────────────────────────╯  │
│                                                                                                                                                                                 │
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/rich/screen.py:47 in __rich_console__                                                                                     │
│                                                                                                                                                                                 │
│   44 │   │   width, height = options.size                                                    ╭────────────────────────────── locals ──────────────────────────────╮             │
│   45 │   │   style = console.get_style(self.style) if self.style else None                   │        console = <console width=179 ColorSystem.EIGHT_BIT>         │             │
│   46 │   │   render_options = options.update(width=width, height=height)                     │         height = 71                                                │             │
│ ❱ 47 │   │   lines = console.render_lines(                                                   │        options = ConsoleOptions(                                   │             │
│   48 │   │   │   self.renderable or "", render_options, style=style, pad=True                │                  │   size=ConsoleDimensions(width=179, height=71), │             │
│   49 │   │   )                                                                               │                  │   legacy_windows=False,                         │             │
│   50 │   │   lines = Segment.set_shape(lines, width, height, style=style)                    │                  │   min_width=1,                                  │             │
│                                                                                              │                  │   max_width=179,                                │             │
│                                                                                              │                  │   is_terminal=True,                             │             │
│                                                                                              │                  │   encoding='utf-8',                             │             │
│                                                                                              │                  │   max_height=71,                                │             │
│                                                                                              │                  │   justify=None,                                 │             │
│                                                                                              │                  │   overflow=None,                                │             │
│                                                                                              │                  │   no_wrap=None,                                 │             │
│                                                                                              │                  │   highlight=None,                               │             │
│                                                                                              │                  │   markup=None,                                  │             │
│                                                                                              │                  │   height=None                                   │             │
│                                                                                              │                  )                                                 │             │
│                                                                                              │ render_options = ConsoleOptions(                                   │             │
│                                                                                              │                  │   size=ConsoleDimensions(width=179, height=71), │             │
│                                                                                              │                  │   legacy_windows=False,                         │             │
│                                                                                              │                  │   min_width=179,                                │             │
│                                                                                              │                  │   max_width=179,                                │             │
│                                                                                              │                  │   is_terminal=True,                             │             │
│                                                                                              │                  │   encoding='utf-8',                             │             │
│                                                                                              │                  │   max_height=71,                                │             │
│                                                                                              │                  │   justify=None,                                 │             │
│                                                                                              │                  │   overflow=None,                                │             │
│                                                                                              │                  │   no_wrap=None,                                 │             │
│                                                                                              │                  │   highlight=None,                               │             │
│                                                                                              │                  │   markup=None,                                  │             │
│                                                                                              │                  │   height=71                                     │             │
│                                                                                              │                  )                                                 │             │
│                                                                                              │           self = <rich.screen.Screen object at 0x10b03e0d0>        │             │
│                                                                                              │          style = None                                              │             │
│                                                                                              │          width = 179                                               │             │
│                                                                                              ╰────────────────────────────────────────────────────────────────────╯             │
│                                                                                                                                                                                 │
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/rich/console.py:1261 in render_lines                                                                                      │
│                                                                                                                                                                                 │
│   1258 │   │   │   _rendered = self.render(renderable, render_options)                         ╭────────────────────────────── locals ──────────────────────────────╮           │
│   1259 │   │   │   if style:                                                                   │      _rendered = <generator object Console.render at 0x10aff7eb0>  │           │
│   1260 │   │   │   │   _rendered = Segment.apply_style(_rendered, style)                       │      new_lines = False                                             │           │
│ ❱ 1261 │   │   │   lines = list(                                                               │        options = ConsoleOptions(                                   │           │
│   1262 │   │   │   │   islice(                                                                 │                  │   size=ConsoleDimensions(width=179, height=71), │           │
│   1263 │   │   │   │   │   Segment.split_and_crop_lines(                                       │                  │   legacy_windows=False,                         │           │
│   1264 │   │   │   │   │   │   _rendered,                                                      │                  │   min_width=179,                                │           │
│                                                                                                │                  │   max_width=179,                                │           │
│                                                                                                │                  │   is_terminal=True,                             │           │
│                                                                                                │                  │   encoding='utf-8',                             │           │
│                                                                                                │                  │   max_height=71,                                │           │
│                                                                                                │                  │   justify=None,                                 │           │
│                                                                                                │                  │   overflow=None,                                │           │
│                                                                                                │                  │   no_wrap=None,                                 │           │
│                                                                                                │                  │   highlight=None,                               │           │
│                                                                                                │                  │   markup=None,                                  │           │
│                                                                                                │                  │   height=71                                     │           │
│                                                                                                │                  )                                                 │           │
│                                                                                                │            pad = True                                              │           │
│                                                                                                │ render_options = ConsoleOptions(                                   │           │
│                                                                                                │                  │   size=ConsoleDimensions(width=179, height=71), │           │
│                                                                                                │                  │   legacy_windows=False,                         │           │
│                                                                                                │                  │   min_width=179,                                │           │
│                                                                                                │                  │   max_width=179,                                │           │
│                                                                                                │                  │   is_terminal=True,                             │           │
│                                                                                                │                  │   encoding='utf-8',                             │           │
│                                                                                                │                  │   max_height=71,                                │           │
│                                                                                                │                  │   justify=None,                                 │           │
│                                                                                                │                  │   overflow=None,                                │           │
│                                                                                                │                  │   no_wrap=None,                                 │           │
│                                                                                                │                  │   highlight=None,                               │           │
│                                                                                                │                  │   markup=None,                                  │           │
│                                                                                                │                  │   height=71                                     │           │
│                                                                                                │                  )                                                 │           │
│                                                                                                │     renderable = <rich.console.Group object at 0x10b03e4c0>        │           │
│                                                                                                │           self = <console width=179 ColorSystem.EIGHT_BIT>         │           │
│                                                                                                │          style = None                                              │           │
│                                                                                                ╰────────────────────────────────────────────────────────────────────╯           │
│                                                                                                                                                                                 │
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/rich/segment.py:269 in split_and_crop_lines                                                                               │
│                                                                                                                                                                                 │
│   266 │   │   adjust_line_length = cls.adjust_line_length                                                                                                                       │
│   267 │   │   new_line_segment = cls("\n")                                                                                                                                      │
│   268 │   │                                                                                                                                                                     │
│ ❱ 269 │   │   for segment in segments:                                                                                                                                          │
│   270 │   │   │   if "\n" in segment.text and not segment.control:                                                                                                              │
│   271 │   │   │   │   text, style, _ = segment                                                                                                                                  │
│   272 │   │   │   │   while text:                                                                                                                                               │
│                                                                                                                                                                                 │
│ ╭───────────────────────────────────────────── locals ─────────────────────────────────────────────╮                                                                            │
│ │ adjust_line_length = <bound method Segment.adjust_line_length of <class 'rich.segment.Segment'>> │                                                                            │
│ │             append = <built-in method append of list object at 0x10b04bdc0>                      │                                                                            │
│ │                cls = <class 'rich.segment.Segment'>                                              │                                                                            │
│ │  include_new_lines = False                                                                       │                                                                            │
│ │             length = 179                                                                         │                                                                            │
│ │               line = [Segment('\x1b[H', None, [(<ControlType.HOME: 3>,)])]                       │                                                                            │
│ │   new_line_segment = Segment('\n',)                                                              │                                                                            │
│ │                pad = True                                                                        │                                                                            │
│ │            segment = Segment('\x1b[H', None, [(<ControlType.HOME: 3>,)])                         │                                                                            │
│ │           segments = <generator object Console.render at 0x10aff7eb0>                            │                                                                            │
│ │              style = None                                                                        │                                                                            │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                            │
│                                                                                                                                                                                 │
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/rich/console.py:1230 in render                                                                                            │
│                                                                                                                                                                                 │
│   1227 │   │   │   if isinstance(render_output, _Segment):                                     ╭────────────────────────────────── locals ──────────────────────────────────╮   │
│   1228 │   │   │   │   yield render_output                                                     │        _options = ConsoleOptions(                                          │   │
│   1229 │   │   │   else:                                                                       │                   │   size=ConsoleDimensions(width=179, height=71),        │   │
│ ❱ 1230 │   │   │   │   yield from self.render(render_output, _options)                         │                   │   legacy_windows=False,                                │   │
│   1231 │                                                                                       │                   │   min_width=179,                                       │   │
│   1232 │   def render_lines(                                                                   │                   │   max_width=179,                                       │   │
│   1233 │   │   self,                                                                           │                   │   is_terminal=True,                                    │   │
│                                                                                                │                   │   encoding='utf-8',                                    │   │
│                                                                                                │                   │   max_height=71,                                       │   │
│                                                                                                │                   │   justify=None,                                        │   │
│                                                                                                │                   │   overflow=None,                                       │   │
│                                                                                                │                   │   no_wrap=None,                                        │   │
│                                                                                                │                   │   highlight=None,                                      │   │
│                                                                                                │                   │   markup=None,                                         │   │
│                                                                                                │                   │   height=71                                            │   │
│                                                                                                │                   )                                                        │   │
│                                                                                                │        _Segment = <class 'rich.segment.Segment'>                           │   │
│                                                                                                │     iter_render = <generator object Group.__rich_console__ at 0x10aff7d60> │   │
│                                                                                                │         options = ConsoleOptions(                                          │   │
│                                                                                                │                   │   size=ConsoleDimensions(width=179, height=71),        │   │
│                                                                                                │                   │   legacy_windows=False,                                │   │
│                                                                                                │                   │   min_width=179,                                       │   │
│                                                                                                │                   │   max_width=179,                                       │   │
│                                                                                                │                   │   is_terminal=True,                                    │   │
│                                                                                                │                   │   encoding='utf-8',                                    │   │
│                                                                                                │                   │   max_height=71,                                       │   │
│                                                                                                │                   │   justify=None,                                        │   │
│                                                                                                │                   │   overflow=None,                                       │   │
│                                                                                                │                   │   no_wrap=None,                                        │   │
│                                                                                                │                   │   highlight=None,                                      │   │
│                                                                                                │                   │   markup=None,                                         │   │
│                                                                                                │                   │   height=71                                            │   │
│                                                                                                │                   )                                                        │   │
│                                                                                                │ render_iterable = <generator object Group.__rich_console__ at 0x10aff7d60> │   │
│                                                                                                │   render_output = DockView(name='DockView#1')                              │   │
│                                                                                                │      renderable = <rich.console.Group object at 0x10b03e4c0>               │   │
│                                                                                                │            self = <console width=179 ColorSystem.EIGHT_BIT>                │   │
│                                                                                                ╰────────────────────────────────────────────────────────────────────────────╯   │
│                                                                                                                                                                                 │
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/rich/console.py:1226 in render                                                                                            │
│                                                                                                                                                                                 │
│   1223 │   │   │   │   f"object {render_iterable!r} is not renderable"                         ╭────────────────────────────────── locals ───────────────────────────────────╮  │
│   1224 │   │   │   )                                                                           │        _options = ConsoleOptions(                                           │  │
│   1225 │   │   _Segment = Segment                                                              │                   │   size=ConsoleDimensions(width=179, height=71),         │  │
│ ❱ 1226 │   │   for render_output in iter_render:                                               │                   │   legacy_windows=False,                                 │  │
│   1227 │   │   │   if isinstance(render_output, _Segment):                                     │                   │   min_width=179,                                        │  │
│   1228 │   │   │   │   yield render_output                                                     │                   │   max_width=179,                                        │  │
│   1229 │   │   │   else:                                                                       │                   │   is_terminal=True,                                     │  │
│                                                                                                │                   │   encoding='utf-8',                                     │  │
│                                                                                                │                   │   max_height=71,                                        │  │
│                                                                                                │                   │   justify=None,                                         │  │
│                                                                                                │                   │   overflow=None,                                        │  │
│                                                                                                │                   │   no_wrap=None,                                         │  │
│                                                                                                │                   │   highlight=None,                                       │  │
│                                                                                                │                   │   markup=None,                                          │  │
│                                                                                                │                   │   height=71                                             │  │
│                                                                                                │                   )                                                         │  │
│                                                                                                │        _Segment = <class 'rich.segment.Segment'>                            │  │
│                                                                                                │     iter_render = <generator object Layout.__rich_console__ at 0x10aff7dd0> │  │
│                                                                                                │         options = ConsoleOptions(                                           │  │
│                                                                                                │                   │   size=ConsoleDimensions(width=179, height=71),         │  │
│                                                                                                │                   │   legacy_windows=False,                                 │  │
│                                                                                                │                   │   min_width=179,                                        │  │
│                                                                                                │                   │   max_width=179,                                        │  │
│                                                                                                │                   │   is_terminal=True,                                     │  │
│                                                                                                │                   │   encoding='utf-8',                                     │  │
│                                                                                                │                   │   max_height=71,                                        │  │
│                                                                                                │                   │   justify=None,                                         │  │
│                                                                                                │                   │   overflow=None,                                        │  │
│                                                                                                │                   │   no_wrap=None,                                         │  │
│                                                                                                │                   │   highlight=None,                                       │  │
│                                                                                                │                   │   markup=None,                                          │  │
│                                                                                                │                   │   height=71                                             │  │
│                                                                                                │                   )                                                         │  │
│                                                                                                │ render_iterable = <generator object Layout.__rich_console__ at 0x10aff7dd0> │  │
│                                                                                                │      renderable = <textual.layouts.dock.DockLayout object at 0x10b024250>   │  │
│                                                                                                │            self = <console width=179 ColorSystem.EIGHT_BIT>                 │  │
│                                                                                                ╰─────────────────────────────────────────────────────────────────────────────╯  │
│                                                                                                                                                                                 │
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/textual/layout.py:376 in __rich_console__                                                                                 │
│                                                                                                                                                                                 │
│   373 │   def __rich_console__(                                                               ╭───────────────────────────── locals ──────────────────────────────╮             │
│   374 │   │   self, console: Console, options: ConsoleOptions                                 │ console = <console width=179 ColorSystem.EIGHT_BIT>               │             │
│   375 │   ) -> RenderResult:                                                                  │ options = ConsoleOptions(                                         │             │
│ ❱ 376 │   │   yield self.render(console)                                                      │           │   size=ConsoleDimensions(width=179, height=71),       │             │
│   377 │                                                                                       │           │   legacy_windows=False,                               │             │
│   378 │   def update_widget(self, console: Console, widget: Widget) -> LayoutUpdate | None:   │           │   min_width=179,                                      │             │
│   379 │   │   if widget not in self.regions:                                                  │           │   max_width=179,                                      │             │
│                                                                                               │           │   is_terminal=True,                                   │             │
│                                                                                               │           │   encoding='utf-8',                                   │             │
│                                                                                               │           │   max_height=71,                                      │             │
│                                                                                               │           │   justify=None,                                       │             │
│                                                                                               │           │   overflow=None,                                      │             │
│                                                                                               │           │   no_wrap=None,                                       │             │
│                                                                                               │           │   highlight=None,                                     │             │
│                                                                                               │           │   markup=None,                                        │             │
│                                                                                               │           │   height=71                                           │             │
│                                                                                               │           )                                                       │             │
│                                                                                               │    self = <textual.layouts.dock.DockLayout object at 0x10b024250> │             │
│                                                                                               ╰───────────────────────────────────────────────────────────────────╯             │
│                                                                                                                                                                                 │
│ /Users/hhip/src/baxi/venv/lib/python3.9/site-packages/textual/layout.py:342 in render                                                                                           │
│                                                                                                                                                                                 │
│   339 │   │   │   │   # last_cut = clamp(render_region.x + render_region.width, clip_x, clip_x                                                                                  │
│   340 │   │   │   │   first_cut = render_region.x                                                                                                                               │
│   341 │   │   │   │   last_cut = render_region.x_max                                                                                                                            │
│ ❱ 342 │   │   │   │   final_cuts = [cut for cut in cuts[y] if (last_cut >= cut >= first_cut)]                                                                                   │
│   343 │   │   │   │   # final_cuts = cuts[y]                                                                                                                                    │
│   344 │   │   │   │                                                                                                                                                             │
│   345 │   │   │   │   # log(final_cuts, render_region.x_extents)                                                                                                                │
│                                                                                                                                                                                 │
│ ╭────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────╮                                  │
│ │          _Segment = <class 'rich.segment.Segment'>                                                                                         │                                  │
│ │ background_render = [                                                                                                                      │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   [                                                                                                                  │                                  │
│ │                     │   │   Segment(                                                                                                       │                                  │
│ │                     │   │   │   '                                                                                '+99,                     │                                  │
│ │                     │   │   │   Style(color=Color('black', ColorType.STANDARD, number=0))                                                  │                                  │
│ │                     │   │   )                                                                                                              │                                  │
│ │                     │   ],                                                                                                                 │                                  │
│ │                     │   ... +61                                                                                                            │                                  │
│ │                     ]                                                                                                                      │                                  │
│ │  background_style = Style(color=Color('black', ColorType.STANDARD, number=0))                                                              │                                  │
│ │             chops = [                                                                                                                      │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   {                                                                                                                  │                                  │
│ │                     │   │   0: [Segment('                                                                                '+99,)],          │                                  │
│ │                     │   │   179: None                                                                                                      │                                  │
│ │                     │   },                                                                                                                 │                                  │
│ │                     │   ... +61                                                                                                            │                                  │
│ │                     ]                                                                                                                      │                                  │
│ │              clip = Region(x=0, y=0, width=179, height=71)                                                                                 │                                  │
│ │            clip_y = 0                                                                                                                      │                                  │
│ │           clip_y2 = 71                                                                                                                     │                                  │
│ │           console = <console width=179 ColorSystem.EIGHT_BIT>                                                                              │                                  │
│ │              crop = None                                                                                                                   │                                  │
│ │       crop_region = Region(x=0, y=0, width=179, height=71)                                                                                 │                                  │
│ │               cut = 0                                                                                                                      │                                  │
│ │      cut_segments = [[Segment('                                                                                '+99,)]]                    │                                  │
│ │              cuts = [[0, 179], [0, 179], [0, 179], [0, 179], [0, 179], [0, 179], [0, 179], [0, 179], [0, 179], [0, 179], ... +61]          │                                  │
│ │            divide = <bound method Segment.divide of <class 'rich.segment.Segment'>>                                                        │                                  │
│ │        final_cuts = [0, 179]                                                                                                               │                                  │
│ │         first_cut = 0                                                                                                                      │                                  │
│ │            height = 71                                                                                                                     │                                  │
│ │          last_cut = 179                                                                                                                    │                                  │
│ │              line = [Segment('                                                                                '+99,)]                      │                                  │
│ │             lines = [                                                                                                                      │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   [Segment('                                                                                '+99,)],                 │                                  │
│ │                     │   ... +62                                                                                                            │                                  │
│ │                     ]                                                                                                                      │                                  │
│ │            region = Region(x=0, y=0, width=179, height=71)                                                                                 │                                  │
│ │     render_region = Region(x=0, y=0, width=179, height=71)                                                                                 │                                  │
│ │           renders = [                                                                                                                      │                                  │
│ │                     │   (                                                                                                                  │                                  │
│ │                     │   │   Region(x=0, y=0, width=179, height=71),                                                                        │                                  │
│ │                     │   │   Region(x=0, y=0, width=179, height=71),                                                                        │                                  │
│ │                     │   │   [                                                                                                              │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   [Segment('                                                                                '+99,)],         │                                  │
│ │                     │   │   │   ... +62                                                                                                    │                                  │
│ │                     │   │   ]                                                                                                              │                                  │
│ │                     │   )                                                                                                                  │                                  │
│ │                     ]                                                                                                                      │                                  │
│ │            screen = Region(x=0, y=0, width=179, height=71)                                                                                 │                                  │
│ │          segments = [Segment('                                                                                '+99,)]                      │                                  │
│ │              self = <textual.layouts.dock.DockLayout object at 0x10b024250>                                                                │                                  │
│ │             width = 179                                                                                                                    │                                  │
│ │                 y = 71                                                                                                                     │                                  │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                  │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range
(venv) hhip@ab-mpb-two:~/src/baxi $ 

@willmcgugan
Copy link
Collaborator

Thanks. I’ve seen this myself. I’ll have a fix in the next update.

@abey79
Copy link
Contributor Author

abey79 commented Aug 11, 2021

Awesome!

@willmcgugan willmcgugan added the bug Something isn't working label Aug 12, 2021
@willmcgugan willmcgugan added this to In progress in Kanban Aug 17, 2021
@willmcgugan willmcgugan moved this from In progress to Done in Kanban Aug 18, 2021
@willmcgugan
Copy link
Collaborator

Fixed in 0.1.10

@Textualize Textualize deleted a comment from muideen1990 Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Kanban
  
Done
Development

No branches or pull requests

2 participants