[Twisted-Python] Progressbar via curses for cmdline, LivePage for web

Justin Johnson justinjohnson at fastmail.fm
Tue Aug 26 09:48:02 EDT 2003

I have some questions about displaying console output using curses for
unix and Console or some other module for windows.  I did see posts
earlier about curses and have read the example cursesclient.py file in
cvs, but I still have some questions.

I have several methods in a PB server that do things with DeferredLists. 
I want progress on the overall task to be reported as each of the
callbacks get called.  The way I have been doing this is having my client
subclass pb.Referenceable, defining remote_print on the client, and then
passing the client as an argument to the server's remote calls.  Then
each callback prints a "." when they complete and an "F" upon failure,
thus sort of simulating a progress bar.

This doesn't work when I have multiple tasks going at once whose progress
I want to report separately.  So it seems to me that I need to start
using curses or some other such module.  I would have to define tasks
(something that has its own progress bar) and pass the task or the id to
the task to the callbacks so they would update the appropriate progress

Additionally, I would like to provide similar functionality for a web
interface to the server, using woven, and probably LivePage so that
progress could be communicated back appropriately.

So... I'm going to start digging into this, but I am wondering, has
anyone done this before?  Do you have any pointers for me?


More information about the Twisted-Python mailing list