Walter Mundt wrote: > Ian Ward wrote: >> It's a good start. I was hoping this could be done with >> get_input_descriptors[1] and get_input_nonblocking[2] instead of using >> threads. >> >> [1] http://excess.org/urwid/reference.html#Screen-get_input_descriptors >> [2] http://excess.org/urwid/reference.html#Screen-get_input_nonblocking > > Done. Also, this version adds a handle_reactor parameter. If False, > rather than looping the function simply returns a twisted Deferred that > will trigger when the UI shuts down, whether via an ExitMainLoop call > (callback True) or a different unhandled exception in one of the > handlers passed in (errback).
Great! That was fast, Walter :-) A couple final suggestions: twisted_main_loop needs a docstring explaining what you said above, and the code should be written in a way that I can add it to main_loop.py even on systems without twisted installed - either only import twisted.(...) inside the functions that need those symbols, or handle the ImportError and make twisted_main_loop send a helpful error message. Ian _______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
