[Urwid] urwid.Pile() - ValueError: too many values to unpack
Bernardo Torres
bernardojts at gmail.com
Tue Apr 18 13:30:15 EDT 2006
Hi,
I'm starting to use Urwid and I have a little doubt about this program I made:
#!/usr/bin/python
import time, xmlrpclib, urwid, urwid.curses_display
ui = urwid.curses_display.Screen()
ui.register_palette([
('header', 'dark blue', 'black', 'standout'),
('bg', 'black', 'dark blue'),
])
def main():
server = xmlrpclib.ServerProxy("http://localhost:8082")
modules = server.list_modules()
size = ui.get_cols_rows()
header = urwid.AttrWrap(urwid.Text("Welcome to the urwid tour! UP /
DOWN / PAGE UP / PAGE DOWN scroll. F8 exits."), 'header')
mods = []
for mod in modules:
mods.append(urwid.AttrWrap(urwid.Text(mod["name"]), 'header'))
mods = urwid.ListBox(mods)
title = urwid.Text(('header', "Diag"))
footer = urwid.Text(('header', "Aperte F8 para sair"))
body = mods
box = urwid.Pile([title, body, footer])
canvas = box.render(size)
while True:
ui.draw_screen(size, canvas)
time.sleep(1)
ui.run_wrapper(main)
I'm getting this everytime:
Traceback (most recent call last):
File "./diag", line 26, in ?
ui.run_wrapper(main)
File "/usr/lib/python2.4/site-packages/urwid/curses_display.py",
line 174, in run_wrapper
return fn()
File "./diag", line 22, in main
canvas = box.render(size)
File "/usr/lib/python2.4/site-packages/urwid/widget.py", line 1626, in render
def render(self, (maxcol,), focus=False):
ValueError: too many values to unpack
bernardo at iraque:~/codes/dialogger$
What I wanted to do is something like what's in the attachment.
Any idea would be nice.
Thanks,
Bernardo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: urwid.JPG
Type: image/jpeg
Size: 12054 bytes
Desc: not available
Url : http://lists.excess.org/pipermail/urwid/attachments/20060418/df45c557/urwid.jpe
More information about the Urwid
mailing list