[Urwid] MainLoop.remove_watch_pipe doesn't work?

Andrew Wu andrewwu.tw at gmail.com
Wed Feb 15 03:24:19 EST 2012


Hello,

I tried to call MainLoop.remove_watch_pipe, but it doesn't work:

####

import urwid

txt = urwid.Text(u"Hello World")
fill = urwid.Filler(txt, 'top')
loop = urwid.MainLoop(fill)

def callback(data):
    pass

fd = loop.watch_pipe(callback)
loop.remove_watch_pipe(fd)

loop.run()

####

I got error message:

Traceback (most recent call last):
  File "t.py", line 11, in <module>
    loop.remove_watch_pipe(fd)
  File "/home/Andrew Wu/urwid/main_loop.py", line 205, in remove_watch_pipe
    watch_handle, pipe_rd = self._watch_pipes.remove(write_fd)
AttributeError: 'dict' object has no attribute 'remove'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.excess.org/pipermail/urwid/attachments/20120215/0b09a305/attachment.htm 


More information about the Urwid mailing list