[Urwid] ListBoxError - focus_canvas.rows() != focus_rows

Sitti Amarittapark sitti at pancetera.com
Wed Jul 7 13:44:51 EDT 2010


Hi all,

I got the following exception in urwid. I found that I can avoid the
problem by resizing the ssh window. However I don't have that option
when running the code in the 80 columns x 24 lines console. Is there
anything I can do to avoid the problem? Did I do anything wrong? I am
using v 0.9.9.1.

Thanks very much,
-Sitti

Traceback (most recent call last):
  File "./console.py", line 235, in <module>
    main()
  File "./console.py", line 230, in main
    gSystem.run('welcome')
  File "/d2/sm/console/pic/manage.py", line 92, in run
    self.runOne(viewId, param)
  File "/d2/sm/console/pic/manage.py", line 126, in runOne
    self.replaceView(pop, viewId, param)
  File "/d2/sm/console/pic/manage.py", line 159, in replaceView
    self.loopController.run()
  File "/d2/sm/console/pic/draw.py", line 311, in run
    self.loop.run()
  File "/usr/lib/python2.5/site-packages/urwid/main_loop.py", line 170, in run
    self.screen.run_wrapper(self._run)
  File "/usr/lib/python2.5/site-packages/urwid/raw_display.py", line
234, in run_wrapper
    return fn()
  File "/usr/lib/python2.5/site-packages/urwid/main_loop.py", line 188, in _run
    self.event_loop.run()
  File "/usr/lib/python2.5/site-packages/urwid/main_loop.py", line 498, in run
    self._loop()
  File "/usr/lib/python2.5/site-packages/urwid/main_loop.py", line 523, in _loop
    self._watch_files[fd]()
  File "/usr/lib/python2.5/site-packages/urwid/main_loop.py", line
238, in _update
    self.draw_screen()
  File "/usr/lib/python2.5/site-packages/urwid/main_loop.py", line
361, in draw_screen
    canvas = self.widget.render(self.screen_size, focus=True)
  File "/usr/lib/python2.5/site-packages/urwid/widget.py", line 135,
in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/widget.py", line 1302, in render
    canv = self._w.render(size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/widget.py", line 135,
in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/container.py", line
1173, in render
    focus = focus and self.focus_col == i)
  File "/usr/lib/python2.5/site-packages/urwid/widget.py", line 135,
in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/decoration.py", line
202, in render
    canv = self._original_widget.render(size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/widget.py", line 135,
in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/container.py", line
569, in render
    focus and self.focus_part == 'body')
  File "/usr/lib/python2.5/site-packages/urwid/widget.py", line 135,
in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/container.py", line
569, in render
    focus and self.focus_part == 'body')
  File "/usr/lib/python2.5/site-packages/urwid/widget.py", line 135,
in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/decoration.py", line
202, in render
    canv = self._original_widget.render(size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/widget.py", line 135,
in cached_render
    canv = fn(self, size, focus=focus)
  File "/usr/lib/python2.5/site-packages/urwid/listbox.py", line 349, in render
    raise ListBoxError, "Focus Widget %s at position %s within listbox
calculated %d rows but rendered %d!"%
(`focus_widget`,`focus_pos`,focus_rows, focus_canvas.rows())
urwid.listbox.ListBoxError: Focus Widget <Padding flow widget <Text
flow widget 'This virtual appliance is named rashid.'> left=1 right=1>
at position 0 within listbox calculated 1 rows but rendered 2!



More information about the Urwid mailing list