Jason Tackaberry wrote: > Update of /cvsroot/freevo/kaa/base/src/notifier > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10093 > > Modified Files: > __init__.py popen.py > Log Message: > Add signals to Process class so that it can be useful without > subclassing;
OK, so maybe we should remove all the subclassing? Having two ways of handling the stdout sounds bad to me. BTW, why do you have a Process in mplayer and not inherit from one? But back to the signals. Maybe remove the stdout and stderr functions to inherit to and also remove the shutdown callback. There isn't much difference between this callback and to connect to the signal. > add readlines() function to Process class to read lines from process > immediately rather than going through the notifier loop; Why? > + # Remove nonblock flag temporarily. > + fcntl.fcntl( self.child.fromchild.fileno(), fcntl.F_SETFL, > os.O_RDWR ) > + lines = self.child.fromchild.readlines() > + lines = map(lambda line: line.strip(), lines) > + fcntl.fcntl( self.child.fromchild.fileno(), fcntl.F_SETFL, > os.O_NONBLOCK ) This is ugly. Maybe it blocks. Is there a good reason why kaa-mplayer uses this? Dischi -- A man generally has two reasons for doing a thing. One that sounds good, and a real one.
pgp92RhRzdyXy.pgp
Description: PGP signature
